Cartesian chart: How to preserve the current zoom setting, redraw the chart, then reapply the zoom


Cartesian chart: How to preserve the current zoom setting, redraw the...
Author
Message
Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K

Hopefully the title is self-explanatory. We have several instances where:
1) A chart is rendered and the the DataZoom tool is used to expand a specific region.
2) There is some reason to redraw the chart
3) We want the original zoom setting to be reapplied, as though the user had reused the DataZoom tool; i.e. with the ability to zoom back out to see the full chart.
What is the easiest way to achieve this? I can see that I can probably use RulerRanges to read the current zoom settings and preserve them. However, how do I "reapply" the zoom in code after redrawing the chart? If I just apply the RulerRanges I do not have the ability to zoom back out.
Thanks
Kevin


Replies
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.3K

Hi Kevin,
The easiest way to zoom back to the origin is to disable paging:

chart.Axis[StandardAxis.PrimaryX].PagingView.Enabled = false;

In order to zoom in to a specified range you can use the Zoom in method of the paging view:

chart.Axis(StandardAxis.PrimaryX).PagingView.ZoomIn(new Nevron.GraphicsCore.NRange1DD(0, 1), 0.001);

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team


Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Works perfectly. Thanks guys.
Kevin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search