How to get the previous asix data before OnZoom?

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

How to get the previous asix data before OnZoom?

Post by David » Wed Jun 21, 2006 8:16 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 21, 2006 11:15 am

Hi David,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Thu Jun 22, 2006 1:00 am

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.
narcis wrote:

Code: Select all

	m_Chart1.GetZoom().SetAnimated(true);
	m_Chart1.GetZoom().SetAnimatedSteps(100);
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.

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jun 22, 2006 8:56 am

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:

Code: Select all

	m_Chart1.GetEnvironment().InternalRepaint();
after initializing the chart so that it fully repaints and goes through OnAfterDraw event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply