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

Zoom in on specific data

2 Answers 55 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Trude
Top achievements
Rank 2
Trude asked on 30 Nov 2012, 06:43 PM
If I have a bar chart with for example 10 bars (either 10 series or 10 bars in the same series); is it possible (via code behind) to zoom in on the top three (or any number)?

2 Answers, 1 is accepted

Sort by
0
Accepted
Missing User
answered on 05 Dec 2012, 03:31 PM
Hi Jorn,

You can zoom in on a specific item or set of items from the RadChartView from code-behind like this:
int startIndex = 2;
int endIndex = 5;
int count = this.data.Count;
 
double selectionStart = (double)startIndex / count;
double selectionEnd = (double)endIndex / count;
var panZoomBar = Telerik.Windows.Controls.ChildrenOfTypeExtensions.ChildrenOfType<PanZoomBar>(this.RadChart1.HorizontalAxis).FirstOrDefault();
panZoomBar.SelectionStart = selectionStart;
panZoomBar.SelectionEnd = selectionEnd;
In the example above, the chart will zoom in horizontally on the items with indexes 2, 3 and 4.

All the best,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Trude
Top achievements
Rank 2
answered on 06 Dec 2012, 08:03 AM
Thank you! This is just what I need!
Tags
ChartView
Asked by
Trude
Top achievements
Rank 2
Answers by
Missing User
Trude
Top achievements
Rank 2
Share this question
or