Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Hilfe bei TChart - BottomAxis (https://www.delphipraxis.net/190210-hilfe-bei-tchart-bottomaxis.html)

Kathmai 12. Sep 2016 19:11

Hilfe bei TChart - BottomAxis
 
Liste der Anhänge anzeigen (Anzahl: 1)
Nabend Leute,

komme heute das erste mal mit TChart in Berührung und habe gleich Probleme.

Die Beschriftung der "BottomAxis" möchte ich so hinbekommen wie auf dem Screenshot aus einem Excel Diagramm. Scheitere aber daran kläglich.

Könntet Ihr mir mal auf die Sprünge helfen...

Vielen Dank.




Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
 var i, w: integer;
     d: double;
     s:String;
begin
 randomize;
// chart1.BottomAxis.Items.Automatic := false;
// chart1.BottomAxis.Items.Clear;



 for i:= 0 to 11 do
   begin
    d:=0;
    w:=0;
    s:='Test - ';
    w:=Random(100);
    d:=Random(99)/100;
    d:=d+w;
    s:=s+inttostr(i+1);
    chart1.Series[0].AddY(d,s);

//    chart1.BottomAxis.Items.Add(d,inttostr(i)+'s');
   end;


end;

Kathmai 12. Sep 2016 19:17

AW: Hilfe bei TChart - BottomAxis
 
Liste der Anhänge anzeigen (Anzahl: 1)
Edit: - Screenshot vom Testprojekt mit TChart hinzugefügt (ging leider nicht beim editieren des Beitrags - Sorry)...

Darlo 12. Sep 2016 19:53

AW: Hilfe bei TChart - BottomAxis
 
Eigentlich einfach
Delphi-Quellcode:
series1.add(100,'X-Beschriftung', clRed)
ungetestet übers Handy getippt.

Der schöne Günther 12. Sep 2016 20:22

AW: Hilfe bei TChart - BottomAxis
 
Eine Achse hat eine Eigenschaft "DateTime" oder so ähnlich. Da kannst du als X-Wert einfach einen TDateTime-Wert eintragen, der TeeChart übernimmt den Rest, also dass auf der X-Achse immer ein Datum und keine simple Zahl dransteht.

Kathmai 13. Sep 2016 22:17

AW: Hilfe bei TChart - BottomAxis
 
Vielen Dank Euch zwei. Hat funktioniert...

Mfg
Thomas


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:07 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz