Autor Beitrag
covel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131

Win XP PRo
Borland D7/C#
BeitragVerfasst: Do 14.07.05 07:52 
hallo, habe folgendes problem. ich will nen chart anzeigen lassen, bei dem das Datum (nicht die Uhrzeit oder so) an einer Achse angezeigt werden soll.
ich lese die daten in eine Array ein.Die Daten sind dort als zb. 11.07.2005 , 12.07.2005 usw... gespeichert wenn ich aber nun das Array mit dem Chart "verknüpfen" will, wird mir auf der x-achse anstatt das richtige Datum folgendes angezeigt: 12.01.24451 , 05.09.26459 usw .



ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
 
    s := TLineSeries.Create(nil);
    s.Clear;
    s.Title := 'Chart Linie 1';
    s.ParentChart := Chart1;
    s.xValues.Datetime := true;
    
    for i := 0 to high(postsartikel) do
    begin
      s.AddXY(datearray[i], strtoint (postsartikel[i].messungswert));
    end;
  end;
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Do 14.07.05 08:26 
Als welcher Typ sind die Daten denn im datearray gespeichert? Wenn du TDateTime verwendest, müsste es eigentlich gehen.

Stefan
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 14.07.05 08:39 
Hallo,

da Du das Datum als Text übergibts, sollte es folgendermassen funktionieren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  ...
  s.Title := 'Chart Linie 1';  
  s.ParentChart := Chart1;  
  //s.xValues.Datetime := true;  
      
  for i := 0 to high(postsartikel) do  
  begin  
    s.AddXY(postsartikel[i].messungswert, datearray[i]);  
  end;  
  ...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
covel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131

Win XP PRo
Borland D7/C#
BeitragVerfasst: Do 14.07.05 11:42 
datearray war als variant deklariert. habe sie als tdatetime deklariert funkt. jetzt .

besten dank für eure hilfe