Page 1 of 1

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

Posted: Tue Dec 16, 2014 8:49 am
by 16568648
How are the y-axis min/max values automatically updated after a scroll/zoom. e.g. Setting LeftAxis.Automatic = True doesn't help.

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

Posted: Tue Dec 16, 2014 9:20 am
by yeray
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;