Hello.
It's a simple question but.. how can I cancel zooming?
I did Zoom(...) and after some user actions I want to return to original view.
Or I select region on graph and after some action want to return to original view..
I've found RevertAxisRanges and PopFromZoomStack but I'm not sure that it is right way.
Thank you.
Zoom cancel
Moderator: Queue Moderators
Re: Zoom cancel
Range reverting might be the best choice for you. Just set ViewXY.ZoomPanOptions.RightToLeftZoomAction to RevertAxisRange and update axis' RangeRevertMinimum and RangeRevertMaximun properties after each range change so that chart knows where to revert next when right-to-left zooming is performed.
Re: Zoom cancel
Ok, thank you. But if I use Zoom() method and don't want to use RightToLeft... LeftToRight... operations what is the best way to revert zooming?ArctionJari wrote:Range reverting might be the best choice for you. Just set ViewXY.ZoomPanOptions.RightToLeftZoomAction to RevertAxisRange and update axis' RangeRevertMinimum and RangeRevertMaximun properties after each range change so that chart knows where to revert next when right-to-left zooming is performed.
And additional questionы
If I get rectangle coordinates for Zoom(x1, y1, x2, y2) but want to zoom only X or Y direction how can I do it (get xMax coordinate and xMin coordinate for graph or Ymax/Ymin )?
When I selected area for zooming with mouse I want to zoom after some asynchronous actions (getting answer from another application etc.). So I set Cancel to False in OnBeforeZooming() and call Zoom(...) in my other function (which called by another app). It is possible not to remove rectangle (for zooming area) after OnBeforeZooming() and remove it after my call of Zoom() function?
Thank you.
Re: Zoom cancel
How about storing range revert min/max as I wrote and use those values with SetRange method instead of Zoom method? This should work if you don't want to use mouse for zooming. Or actually you can store the values in your own variables for clarity. Which way feels more natural.
Use X or Y axis' Minimum and Maximum values for Zoom method. I.e. if you want to only zoom Y direction, use X Minimum for startX and X Maximum for stopX. Then your values for startY and StopY. This will "squeeze" the view vertically but keeps original X range. Same logic for squeezing horizontally.
Zooming rectangle is automatically hidden so you cannot change its behavior. How about hiding the real zooming rectangle (set fill and line color to transparent) and using an annotation (no fill, no shadow etc. and line style in dashes) as your "custom" zooming rectangle which you can leave visible while background work is being done and hide it when you call Zoom method?
Use X or Y axis' Minimum and Maximum values for Zoom method. I.e. if you want to only zoom Y direction, use X Minimum for startX and X Maximum for stopX. Then your values for startY and StopY. This will "squeeze" the view vertically but keeps original X range. Same logic for squeezing horizontally.
Zooming rectangle is automatically hidden so you cannot change its behavior. How about hiding the real zooming rectangle (set fill and line color to transparent) and using an annotation (no fill, no shadow etc. and line style in dashes) as your "custom" zooming rectangle which you can leave visible while background work is being done and hide it when you call Zoom method?
Re: Zoom cancel
Thank you. I did something like your suggestions.ArctionJari wrote:How about storing range revert min/max as I wrote and use those values with SetRange method instead of Zoom method? This should work if you don't want to use mouse for zooming. Or actually you can store the values in your own variables for clarity. Which way feels more natural.
Use X or Y axis' Minimum and Maximum values for Zoom method. I.e. if you want to only zoom Y direction, use X Minimum for startX and X Maximum for stopX. Then your values for startY and StopY. This will "squeeze" the view vertically but keeps original X range. Same logic for squeezing horizontally.
Zooming rectangle is automatically hidden so you cannot change its behavior. How about hiding the real zooming rectangle (set fill and line color to transparent) and using an annotation (no fill, no shadow etc. and line style in dashes) as your "custom" zooming rectangle which you can leave visible while background work is being done and hide it when you call Zoom method?