RadChartView Scroll change value

4 posts, 1 answers
  1. Keizo
    Keizo avatar
    18 posts
    Member since:
    Apr 2012

    Posted 14 Mar 2013 Link to this post

    Hi. telerik

    How do I do I can control the amount of scrolling

    see attached image

    I want to make a small change 0.5
    and large change (50 - 45.5) = 4.5

    current is 1 and 10

    Thank you.
  2. Answer
    Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 19 Mar 2013 Link to this post

    Hi Keizo,

    You can use the PanZoomBar's SmallChange and LargeChange properties to do this. They are specified in relative units between 0.0 and 1.0. For example if your range is from 0 to 100, then a small change of 0.5 actual chart units is a SmallChange of 0.005 and a change of 4.5 chart units is a LargeChange of 0.045.

    There are two possible solutions, depending on what your scenario is. If the range of the horizontal axis is constant you can hard-code these values and set them with an implicit style: 
    <telerik:RadCartesianChart.Resources>
      <Style TargetType="telerik:PanZoomBar">
        <Setter Property="SmallChange" Value="0.005"/>
        <Setter Property="LargeChange" Value="0.045"/>
      </Style>
    </telerik:RadCartesianChart.Resources>

    If the range is dynamic, you can attach to the SelectionChanged event of the PanZoomBar to calculate it on the fly. I have attached a project demonstrating this.
     
    Regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Keizo
    Keizo avatar
    18 posts
    Member since:
    Apr 2012

    Posted 20 Mar 2013 Link to this post

    Hi Petar

    My problem is
    also solved in the example that you provide from you.
    Thank you.

    However, there is one question.
    Why is it LayoutUpdate Loaded timing rather than to set a SelectionChanged event?
    LayoutUpdate null can not be used so that sender.
    In a real program it is to deal with multiple charts.
    Was tried with Loaded, the behavior is normal. Is there something wrong?
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 25 Mar 2013 Link to this post

    Hi Keizo,

    The RadCartesianChart.Loaded event can also work, however in some scenarios the PanZoomBar is not present in the visual tree when the Loaded event is raised that is why the LayoutUpdated event is generally the recommended solution. In your project you will have to apply this approach for all of the charts.
     
    Regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top