Page 1 of 1

DateTime on X-Axis (Bottom). How to navigate in code

Posted: Mon Oct 04, 2004 1:31 pm
by 9338361
This is probably an easy question, but I'm totally new at using TeeChart and I can't for the life of me find the solution.

I have a simple 3D Bar chart with dates on the X-axis (at the bottom), each tick is 1 day. I would like to be able to navigate the starting point of the chart to any given date (ie. the user clicks on a DateNavigator and the chart should then start at that date).

Could anyone please point me in the right direction.

Best Regards,

Tom Reiertsen,
Reiertsen Software Systems.

Posted: Mon Oct 04, 2004 3:28 pm
by Marjan
Hi.

The easiest way do perform an axis scroll is to set it's minimum and/or maximum values. In your case, the following code should show one week of data:

Code: Select all

var sdate,edate: TDate;
begin
  sDate := EncodeDate(2004,7,21);
  eDate := sDate + 7; 
  Chart1.Axes.Bottom.SetMinMax(sDate,eDate);
  Chart1.Axes.Bottom.Increment := 1.0; // 1day increment