Re: Date time label shift ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
nileiqi
Newbie
Newbie
Posts: 16
Joined: Wed May 03, 2006 12:00 am

Re: Date time label shift ?

Post by nileiqi » Mon Jan 22, 2007 6:15 am

Hi,

I am new to TeeChart and have questions related to time axis(bottomaxis) control. I have a job to plot a real-time data, the data arrives at every 10 seconds, so it is not very fast data.

My question is how to implement following chart:
(1) I want the chart only display one hour length of data, for example, if current time is 16:00:00, then the left end of axis should be 15:00:00, and the right end should be 16:00:00.

(2) The latest data always be plotted on the very right side, for example, if current time is 16:00:10 and the data arrives, then the time (bottom) axis label at right end side will change to 16:00:10 and left end side is 15:00:10, in other words, the chart shifts left 10 seconds.

(3) The very first data should be plotted at the left end side of bottom, for example, if program starts from 15:00:00. then the 15:00:00 data should be plotted at the left end side of bottom axis, and the chart will plot from left end to right end. Once time is over 16:00:00, then chart starts shift every time when a data arrives.

Can you tell me how to implement this ?

At the moment, the configuration for date time axis (bottom axis) is automatic, so when it starts, the date time axis has no other date time labels except at the middle of the axis, there is a default date time which is 20/12/1899 00:00:00,This default time will stay there until the first data comes in. I don't want it, How do I get rid of it ?

Thanks

Daniel

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jan 22, 2007 8:19 am

Hi Daniel,

Please read this article on how to use TeeChart in real-time applications.
At the moment, the configuration for date time axis (bottom axis) is automatic, so when it starts, the date time axis has no other date time labels except at the middle of the axis, there is a default date time which is 20/12/1899 00:00:00,This default time will stay there until the first data comes in. I don't want it, How do I get rid of it ?


You can try setting minimum and maximum values for the bottom axis before populating the series and then set it back to automatic:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.XValues.DateTime:=true;
  Chart1.Axes.Bottom.SetMinMax(now,now);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chart1.Axes.Bottom.Automatic:=true;
  Series1.FillSampleValues();
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply