Page 1 of 1

TChar 7.04 Change Leftaxis Min/Max

Posted: Thu Mar 24, 2005 2:58 pm
by 9341182
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.

Posted: Tue Mar 29, 2005 8:21 am
by narcis
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;