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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Treierts
Newbie
Newbie
Posts: 4
Joined: Thu Aug 05, 2004 4:00 am
Location: Bergen, Norway
Contact:

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

Post by Treierts » Mon Oct 04, 2004 1:31 pm

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.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Oct 04, 2004 3:28 pm

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
Marjan Slatinek,
http://www.steema.com

Post Reply