Building TChart with time along the X axis

I have a series of 3600 values, every once a second for an hour. I want to draw them as one series using TChart in Delphi 7.

Values ​​should be displayed along the y axis. What should I pass to AddXY () as the value of the x axis? Amount of points?

I want to designate the X axis as MM: SS, how do I do this? What do I need for this? ...

   Chart1.Series[0].XValues.DateTime := True;
   Chart1.BottomAxis.DateTimeFormat := 'nn:ss';

I am stuck for a while with this. Can someone post sample code? Thanks

+3
source share
2 answers

If I'm not mistaken, this is what you want

Series1.AddXY(<Pass the data value>, <Pass Your value>, '', clRed);
Series1.AddXY(now,                     1, '', clRed); 
Series1.AddXY(now + ( 1 /(24*60*60)),  2, '', clRed); //After 1 seconds 
Series1.AddXY(now + ( 2 /(24*60*60)),  3, '', clRed);  //After 2 seconds 
+3
source

You can use the Add function instead of AddXY.

Add( 100, FormatDateTime('nn:ss',Now), clRed ); 
Add( 80, FormatDateTime('nn:ss',Now), clRed );
+3
source

Source: https://habr.com/ru/post/1787628/


All Articles