This is a migrated thread and some comments may be shown as answers.

Trigger ChartView Auto X/Y Rescale

1 Answer 69 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 23 Jun 2017, 07:22 PM

I am allowing the user to pan & zoom on the graph, for example through the following:

ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;

At some point, I set the ScrollMode back to ScrollMode.None and want to reset the ranges of the X & Y axes. I want the ranges to be calculated in the fashion they were when the data were originally drawn.

How can I get the ChartView to recalculate the axis ranges?

Please note that I may add data to the chart before triggering the recalc so just remembering range values before pan/zoom and setting them afterwards won't be sufficient.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 28 Jun 2017, 04:02 PM
Hi Scott,

I think the zoom range start/end properties will work for your case. The properties are HorizontalZoomRangeStart, HorizontalZoomRangeEnd, VerticalZoomRangeStart and VerticalZoomRangeEnd. You can learn more about them in the Scroll and Zoom article. To reset the zoom level you can set the start property to 0 and the end to 1.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView
Asked by
Scott
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or