Am I correct in thinking that zooming causes LeftAxis->Automatic to become false, and unzooming causes it to become true?
If this is the case, is there any way to have its value after zooming the same as is before zooming?
Zoom and Automatic Axes
> Am I correct in thinking that zooming causes LeftAxis->Automatic to become false, and unzooming causes it to become true?
Yes, you're correct.
> If this is the case, is there any way to have its value after zooming the same as is before zooming?
Here you can find a solution.
Yes, you're correct.
> If this is the case, is there any way to have its value after zooming the same as is before zooming?
Here you can find a solution.
Pep Jorge
http://support.steema.com
http://support.steema.com
Let me explain my situation a little more:
I have a chart with 12 y-axes: the default Left and Right axes, and ten custom axes. I have zoom set to horizontal so that you can only zoom the x-axes. I have implemented zoom memory so that when you zoom in it remembers the position of the zoom, and when you zoom out it zooms to the previous zoom area. I also have a custom chart options form which allows you to adjust axis settings, including Min/Max and whether it's Automatic or not.
If automatic is set to false, and a Min/Max is entered, all behaves perfectly. The issue is when automatic is set to true: on all but the LeftAxis and RightAxis, zooming and unzooming causes the axis min/max to scale perfectly with the visible data. For the LeftAxis and the RightAxis, however, zooming in sets the automatic property to false. This causes the axis to stop updating. When you unzoom it sets it back to true, causing it to update as required. As the unzooming is done with a memory, however, it will behave something like this:
What I want to achieve is that if you zoom in, when automatic is true, it will remain set to true and fit to the data. If you zoom in when automatic is false, it will remain set to false.
I have a chart with 12 y-axes: the default Left and Right axes, and ten custom axes. I have zoom set to horizontal so that you can only zoom the x-axes. I have implemented zoom memory so that when you zoom in it remembers the position of the zoom, and when you zoom out it zooms to the previous zoom area. I also have a custom chart options form which allows you to adjust axis settings, including Min/Max and whether it's Automatic or not.
If automatic is set to false, and a Min/Max is entered, all behaves perfectly. The issue is when automatic is set to true: on all but the LeftAxis and RightAxis, zooming and unzooming causes the axis min/max to scale perfectly with the visible data. For the LeftAxis and the RightAxis, however, zooming in sets the automatic property to false. This causes the axis to stop updating. When you unzoom it sets it back to true, causing it to update as required. As the unzooming is done with a memory, however, it will behave something like this:
Code: Select all
Start : Min: 0; Max: 100 [data min: 0; data max: 100]
Zoom In : Min: 0; Max: 100 [data min: 20; data max: 80]
Zoom In : Min: 0; Max: 100 [data min: 40; data max: 60]
Zoom Out: Min: 20; Max: 80 [data min: 20; data max: 80]
Zoom Out: Min: 0; Max: 100 [data min: 0; data max: 100]
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi jhhd,
Thanks in advance.
This works fine for me here using code below. Could you please check if it works fine at your end and let us know the exact TeeChart version you are using?What I want to achieve is that if you zoom in, when automatic is true, it will remain set to true and fit to the data. If you zoom in when automatic is false, it will remain set to false.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Axes.Left.SetMinMax(0,100);
Chart1.Axes.Bottom.SetMinMax(0,100);
end;
procedure TForm1.Chart1Zoom(Sender: TObject);
begin
Caption:=BoolToStr(Chart1.Axes.Left.Automatic) + ', ' +
BoolToStr(Chart1.Axes.Bottom.Automatic);
end;
procedure TForm1.Chart1UndoZoom(Sender: TObject);
begin
Caption:=BoolToStr(Chart1.Axes.Left.Automatic) + ', ' +
BoolToStr(Chart1.Axes.Bottom.Automatic);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |