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

RadChartView Scroll change value

3 Answers 111 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Keizo
Top achievements
Rank 1
Keizo asked on 14 Mar 2013, 10:41 AM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 19 Mar 2013, 10:07 AM
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.

0
Keizo
Top achievements
Rank 1
answered on 21 Mar 2013, 01:47 AM
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?

Thank you.
0
Petar Kirov
Telerik team
answered on 25 Mar 2013, 02:46 PM
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.

Tags
ChartView
Asked by
Keizo
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Keizo
Top achievements
Rank 1
Share this question
or