4

I have a series of 3,600 values, one every second for an hour. I want to chart them as a single series, using TChart in Delphi 7.

The values should be plotted on the Y-axis. What should I pass to AddXY() as the X-axis value? The count of points?

I want to label the X-axis as MM:SS, how do I do that? What do I need beyond this? ...

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

I have been stuck for a while with this one. Can anyone post some sample code? Thanks

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551

2 Answers2

4

You can use Add function instead of AddXY.

Add( 100, FormatDateTime('nn:ss',Now), clRed ); 
Add( 80, FormatDateTime('nn:ss',Now), clRed );
SimaWB
  • 9,246
  • 2
  • 41
  • 46
3

If I am not wrong, 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 
Bharat
  • 6,828
  • 5
  • 35
  • 56