Zoom in on specific data

3 posts, 1 answers
  1. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 30 Nov 2012 Link to this post

    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. Answer
    Missing user
    Missing user avatar

    Posted 05 Dec 2012 Link to this post

    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.

  3. DevCraft R3 2016 release webinar banner
  4. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 06 Dec 2012 Link to this post

    Thank you! This is just what I need!
Back to Top