Hi,
I would like to realize gradual unzoom function, so I have to save the axis data. In which function should I use
m_chart1.GetAxis().GetBottom().GetMaximum();
m_chart1.GetAxis().GetBottom().GetMinimum();
m_chart1.GetAxis().GetLeft().GetMaximum();
m_chart1.GetAxis().GetLeft().GetMinimum();
to get the axis data before OnZoom?
Thank you very much,
David
How to get the previous asix data before OnZoom?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
You could try retrieving the values in TeeChart's OnAfterDraw event.
BTW: Have you tried animated zoom?
You could try retrieving the values in TeeChart's OnAfterDraw event.
BTW: Have you tried animated zoom?
Code: Select all
m_Chart1.GetZoom().SetAnimated(true);
m_Chart1.GetZoom().SetAnimatedSteps(100);
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 |
Hi,
If I retreve the axis values in OnAfterDraw, the values will be for the zoomed chart, not the original chart, so if I push these values into stack and read them in OnUndoZoom, the undozoom will never happen because the values are the same as current axis range.
I am not sure if I made myself clear. This is what I want to do: if I zoom in once, twice, and third times, when I undo the zoom, I want to the axis values to be 2nd zoom values, 1st zoomed values and back to original, instead of jumping directly back to original values. So I have to retrieve the old axis values before OnZoom event is handled.
Thank you very much,
David
If I retreve the axis values in OnAfterDraw, the values will be for the zoomed chart, not the original chart, so if I push these values into stack and read them in OnUndoZoom, the undozoom will never happen because the values are the same as current axis range.
This method can only animate the zoom procedure, but if I undo zoom, the axis values will directly return to the very beginning values, not the values in the last step zoom.narcis wrote:Code: Select all
m_Chart1.GetZoom().SetAnimated(true); m_Chart1.GetZoom().SetAnimatedSteps(100);
I am not sure if I made myself clear. This is what I want to do: if I zoom in once, twice, and third times, when I undo the zoom, I want to the axis values to be 2nd zoom values, 1st zoomed values and back to original, instead of jumping directly back to original values. So I have to retrieve the old axis values before OnZoom event is handled.
Thank you very much,
David
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Ok, now I understand better what you are trying to achieve.
Then I would store axes settings in an array every time OnAfterDraw is fired. The first time would be just after the chart is drawn for the very first time, before zooming, then it would fire after each zooming.
If necessary, use:
after initializing the chart so that it fully repaints and goes through OnAfterDraw event.
Ok, now I understand better what you are trying to achieve.
Then I would store axes settings in an array every time OnAfterDraw is fired. The first time would be just after the chart is drawn for the very first time, before zooming, then it would fire after each zooming.
If necessary, use:
Code: Select all
m_Chart1.GetEnvironment().InternalRepaint();
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 |