TChar 7.04 Change Leftaxis Min/Max

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Achim
Newbie
Newbie
Posts: 5
Joined: Mon Mar 07, 2005 5:00 am

TChar 7.04 Change Leftaxis Min/Max

Post by Achim » Thu Mar 24, 2005 2:58 pm

Put a TChart with a TAreaSeries to a form.
Use following code and zoom with the mouse. The Leftaxis-Minimum/maximum change every time you zoom.

procedure TForm4.Button1Click(Sender: TObject);
var
i:integer;
begin
for i := 0 to 100 do
Series1.AddXY(i,i);
Chart1.Zoom.Direction:=tzdHorizontal;
Chart1.LeftAxis.Automatic:=true;
Chart1.LeftAxis.MinimumOffset:=3;
Chart1.LeftAxis.MaximumOffset:=3;
end;

Workaround: Reset MinimumOffset and MaximumOffset in the OnZoom-event.

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

Post by Narcís » Tue Mar 29, 2005 8:21 am

Hi Achim,

Maybe setting your axis not to be automatically setted can help you. You can do it using something like:

Code: Select all

  With Chart1.LeftAxis do
  begin
    Automatic:=false;
    AutomaticMaximum:=false;
    AutomaticMinimum:=false;
    SetMinMax(AxisMin,AxisMax);
  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