I have some customaxis in my chart which need to bee zoomed.
In the OnZoom Event I use this code:
Code: Select all
procedure TForm1.Chart1Zoom(Sender: TObject);
var Achse : TChartAxis;
i : Byte;
begin
if Chart1.Zoom.Direction in [tzdBoth, tzdVertical] then
for i := 0 to Chart1.SeriesCount - 1 do begin
Achse := Chart1.Series[i].GetVertAxis;
if Achse.Visible then
Achse.SetMinMax(Achse.CalcPosPoint(Chart1.Zoom.Y1),Achse.CalcPosPoint(Chart1.Zoom.Y0));
end;
end;
I use the sample from your helpfile:
Zoom in example:
Code: Select all
Chart1.ZoomRect( Rect( 5,5,Chart1.Width-5,Chart1.Height-5 ) );
Code: Select all
Chart1.ZoomRect( Rect( -5,-5,Chart1.Width+5,Chart1.Height+5 ) );