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

Chartview - reset zoom

3 Answers 219 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 26 Jul 2012, 05:57 PM
Greetings,

I would like to programmatically reset the zoom level (undo all zooming) on a RadCartesianChart.  What is the recommended way to handle that?

I have tried
radChartView.Zoom = new Size(1,1);

as well as

radChartView.Zoom = Size.Empty;

And both result in incorrect / awkward behavior.

Thanks,
Shaun

3 Answers, 1 is accepted

Sort by
0
Shaun
Top achievements
Rank 1
answered on 26 Jul 2012, 08:38 PM
Side note:  This will happen when the dataset is changed.

Example: 

  • The user has selected May 1, 2012.  
  • The graph is updated to show 1000 data points throughout the day
  • The user zooms in to take a closer look
  • The user changes days and chooses May 2, 2012

At this point, I want to reset the zoom of the chart and display data for May 2.

My current method of hooking into the DataSource changing and setting zoom to 1,1 at that point doesnt seem to work (very buggy, arbitrary date ranges are shown, scrollbar is weird)

0
Rosko
Telerik team
answered on 31 Jul 2012, 10:52 AM
Hi Shaun,

Besides resetting the zoom, you need also to reset the panning. You need to do the two things together.
chartView.Zoom = new Size(1, 1);
chartView.PanOffset = new Point(0, 0);
I hope this will help you to achieve the desired effect.


Greetings,
Rosko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Shaun
Top achievements
Rank 1
answered on 31 Jul 2012, 01:50 PM
Perfect, thanks!
Tags
ChartView
Asked by
Shaun
Top achievements
Rank 1
Answers by
Shaun
Top achievements
Rank 1
Rosko
Telerik team
Share this question
or