TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
madve
- Newbie
- Posts: 52
- Joined: Thu Feb 16, 2006 12:00 am
Post
by madve » Thu Aug 10, 2006 7:47 pm
Hi,
I have several vertical Custom axes on my Chart. I found some code in your FAQ how to zoom custom axes.
It works fine when I zoom with Zoom tool (hold down left mouse button and select a rectangle), but it do not work when I Zoom with the following code:
I used the following code to zoom my custom axes:
Code: Select all
procedure TUserControl.TChart_Felso_Zoomed(sender: System.Object; e: System.EventArgs);
var
I: Integer;
ax : Steema.TeeChart.Axis;
begin
for I := 0 to TChart_Felso.Axes.Custom.Count - 1 do
begin
ax := TChart_Felso.Axes.Custom[ i ];
with ax do
begin
Debug.Write( 'y1 = ' + TChart_Felso.Zoom.y1.ToString);
Debug.Write( 'y0 = ' + TChart_Felso.Zoom.y0.ToString );
SetMinMax( CalcPosPoint( TChart_Felso.Zoom.y1 ),
CalcPosPoint( TChart_Felso.Zoom.y0 )
);
end;
end;
end;
Best regards,
Gabor Varga
-
Christopher
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
-
Contact:
Post
by Christopher » Fri Aug 11, 2006 7:05 am
Hello,
Instead of using the ZoomPercent method you should use the Axis.SetMinMax method. Internally this is what ZoomPercent does anyway.
-
madve
- Newbie
- Posts: 52
- Joined: Thu Feb 16, 2006 12:00 am
Post
by madve » Fri Aug 11, 2006 1:47 pm
Hi,
It is not clear for me, could you reproduce the problem?
Yes, I can use SetMinMax, but then I have to care about preserve original zoom values except using Zoom.Undo.
Best regards,
Gabor Varga
-
Christopher
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
-
Contact:
Post
by Christopher » Fri Aug 11, 2006 2:00 pm
Hello,
Automatic zoom is not available for custom axes. You have to code the zoom manually using SetMinMax which may include saving the old MinMax values in a variable to undo the 'zoom' at a later moment.