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

ChartPanAndZoomBehavior zoom and pan together

2 Answers 184 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Zberbang
Top achievements
Rank 2
Zberbang asked on 08 Oct 2013, 11:05 AM
Hello all!
I want to have Zoom and Pan behavior together on one chart:
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior DragMode="Zoom" ZoomMode="Both" />
<telerik:ChartPanAndZoomBehavior DragMode="Pan" PanMode="Both" />
</telerik:RadCartesianChart.Behaviors>

If I do so, zoom behavoir is not working properly - no zoom inside rectangle occurs.
Is it possible to do? Or may be it id possible to activate Pan behavior only when Ctrl is pressed?

p.s. I'm using Q2 2013 demos.

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 09 Oct 2013, 10:14 AM
Hi Les,

RadChartView controls (RadCartesianChart, RadPolarChart and RadPieChart) require that only a single instance of each chart behavior type is present in the Chart.Behaviors collection. Having more than one ChartPanAndZoomBehavior (for example) is undefined.

I would recommend leaving only the second ChartPanAndZoomBehavior definition, and using the KeyUp and KeyDown events to toggle the DragMode to Zoom and back to Pan (when for example Ctrl is pressed / released).

I have attached a sample project to demonstrate.

Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Zberbang
Top achievements
Rank 2
answered on 14 Oct 2013, 08:11 AM
Hi Petar,

thanks for provided details.
Tags
ChartView
Asked by
Zberbang
Top achievements
Rank 2
Answers by
Petar Kirov
Telerik team
Zberbang
Top achievements
Rank 2
Share this question
or