Autor Beitrag
Jangojack
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

win xp
Delphi 2005 personal,Delphi 7 Enterprise
BeitragVerfasst: Do 14.09.06 11:48 
hallo,

ich speichere mit meinem prog. daten in ner mysql datenbank und zeige sie in einem

stringgrid an...

nun möchte ich diese daten in einem diagramm darstellen:(immer nur die letzten 10)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure tform1.chart;
var
i: integer;
s:string;
begin
for i:=(Form1.StringGrid2.Rowcount-1)-10 to (Form1.StringGrid2.Rowcount-1) do begin
   series1.addxy(i,strtoint(Form1.StringGrid2.cells[3,i]));
end;


das müsste soweit ja auch klappen, nur, dass ich werte voen X,XX habe und die nicht

einem integer entsprechen, so das mir immer ne fehlermeldung rausgehauen wird...

kann mir da jemand helfen???

mfg Johannes


Zuletzt bearbeitet von Jangojack am Do 14.09.06 11:51, insgesamt 1-mal bearbeitet
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 14.09.06 11:54 
suchst du vielleicht strtofloat ??

_________________
Anonymes Eckenkind
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 14.09.06 12:02 
user profile iconJangojack hat folgendes geschrieben:

nur, dass ich werte voen X,XX habe und die nicht einem integer entsprechen, so das mir immer ne fehlermeldung rausgehauen wird...

kann mir da jemand helfen???


Du willst also X,XX zu einem Integer haben?
Das geht mir Round(real) oder Trunc(real) (rundet bzw schneidet die nachkommastellen ab)
Jangojack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

win xp
Delphi 2005 personal,Delphi 7 Enterprise
BeitragVerfasst: Do 14.09.06 12:17 
hehe

nein ich möchte den wert nicht auf integer runden

ich möchte den wert so wie der ist (X,XX)

in dem grid anzeigen

mfg johannes
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 14.09.06 12:24 
s.o.
hab doch gesagt, du brauchst dann halt real, nicht integer...
und dann nicht mit strtoint sondern mit strtofloat umwandeln ;)

_________________
Anonymes Eckenkind
Jangojack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

win xp
Delphi 2005 personal,Delphi 7 Enterprise
BeitragVerfasst: Do 14.09.06 12:46 
Titel: jo
user profile iconMiri hat folgendes geschrieben:
s.o.
hab doch gesagt, du brauchst dann halt real, nicht integer...
und dann nicht mit strtoint sondern mit strtofloat umwandeln ;)


ja ich weiß,dass ich einen real brauchen, da es ja real-werte sind

aber wie - das ist meine frage :) :)

mfg jo
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 14.09.06 13:21 
OK, sag noch mal dein Problem!
x --> Real
Du willst etwas als Real haben, aber sag uns nochmal was, bitte!
Jangojack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

win xp
Delphi 2005 personal,Delphi 7 Enterprise
BeitragVerfasst: Do 14.09.06 13:34 
ich habe gegooglet wie man aus einem stringgrid daten in ein diagramm holt

und etwas so wie ähnlich wie hier war das resultat:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure tform1.chart; 
var  
i: integer;  
 
begin  
for i:=(Form1.StringGrid2.Rowcount-1)-10 to (Form1.StringGrid2.Rowcount-1) do begin  
   series1.addxy(i,strtoint(Form1.StringGrid2.cells[3,i]));  
end;


da ich jedoch werte im format X.XX erhalte) und diese genau so (nicht gerundet)

im diagramm anzeigen möchte funktioniert es so nicht, da ich hier mit integer arbeite

aber für x.xx real bräuchte

ich weiß aber nicht wie...

einfach
ausblenden Delphi-Quelltext
1:
i : real;					

und
ausblenden Delphi-Quelltext
1:
series1.addxy(i,strtofloat(Form1.StringGrid2.cells[3,i]					


funktionieren nicht

also ich will die werte die ich bekomme so wie sie sind im diagramm wiedergaben
..............
..........
........
......
....
...
..
.
Jangojack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

win xp
Delphi 2005 personal,Delphi 7 Enterprise
BeitragVerfasst: Do 14.09.06 14:33 
help! :shock: