How to adjust y-axis min/max after scroll/zoom

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ChristianH
Newbie
Newbie
Posts: 5
Joined: Tue Mar 04, 2014 12:00 am

How to adjust y-axis min/max after scroll/zoom

Post by ChristianH » Tue Dec 16, 2014 8:49 am

How are the y-axis min/max values automatically updated after a scroll/zoom. e.g. Setting LeftAxis.Automatic = True doesn't help.

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to adjust y-axis min/max after scroll/zoom

Post by Yeray » Tue Dec 16, 2014 9:20 am

Hello,

You can use the Chart OnZoom event to modify the axis scale as you want.
Ie:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Chart1.AddSeries(TPointSeries).FillSampleValues();
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  with Chart1.Axes.Left do
    SetMinMax(Minimum-5, Maximum+5);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply