ChartPanAndZoomBehavior zoom and pan together

3 posts, 1 answers
  1. Zberbang
    Zberbang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 08 Oct 2013 Link to this post

    Hello all!
    I want to have Zoom and Pan behavior together on one chart:
    <telerik:ChartPanAndZoomBehavior DragMode="Zoom" ZoomMode="Both" />
    <telerik:ChartPanAndZoomBehavior DragMode="Pan" PanMode="Both" />

    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. Answer
    Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 09 Oct 2013 Link to this post

    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.

    Petar Kirov
    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 >>
  3. DevCraft R3 2016 release webinar banner
  4. Zberbang
    Zberbang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2013 Link to this post

    Hi Petar,

    thanks for provided details.
Back to Top