TChart botton range of graph

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Glenn
Newbie
Newbie
Posts: 2
Joined: Fri Nov 15, 2002 12:00 am
Location: Atlanta GA

TChart botton range of graph

Post by Glenn » Thu Jan 08, 2004 8:31 pm

I have a Delphi Tchart designed and working great. The problem is that the customer has now called and wants us to make the bottom range a set value instead of having it automatically set based on the data fed to the chart.

Is there a way to set the bottom range to say 1000 and have the graph just stop at whatever point its time ends? ie: If I've only logged 500 hours then the chart would move across to the middle of the graph and just stop with the last point in the middle of the graph?

Thanks,

glenn

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

Post by Marjan » Thu Jan 08, 2004 9:48 pm

Hi, Glenn.

In case you want to manually set axis range, this can be done by using axis SetMinMax method. For example:

Code: Select all

var StartPoint,Range : double;
StartPoint := 0.0;
Range := 1000.0;
With Chart1.Axes.Bottom do
begin
  Automatic := False;
  Increment := Range / 10; // show 10 labels, just an example
  SetMinMax(StartPoint, StartPoint+Range);
end;
Marjan Slatinek,
http://www.steema.com

Glenn
Newbie
Newbie
Posts: 2
Joined: Fri Nov 15, 2002 12:00 am
Location: Atlanta GA

Post by Glenn » Fri Jan 09, 2004 9:37 pm

Marjan,

thanks a lot, that worked perfectly. Had to change the class method name a little but other than that it worked perfectly. For those interested the exact name is:

Chart1.BottomAxis

thanks again,

glenn

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jan 12, 2004 11:11 am

Hi glenn,

ok, yes this will do the same, but in the TeeChart Pro v6 we've introduced a new property (Chart.Axes.) which we recommend to use it instead.

Josep Lluis Jorge
http://support.steema.com

Post Reply