Zooming & Panning with mouse and without scrollbar

4 posts, 0 answers
  1. Nitin Nitin
    Nitin Nitin avatar
    41 posts
    Member since:
    Apr 2010

    Posted 28 Mar 2013 Link to this post

    Hello,

    I am working with RadCartesianChart and had a requirement where zooming and panning needs to be implemented without using scrollbars.
    Users would actually use the mouse to zoom and pan whenever they require.

    Please suggest me a solution.

    Thanks,
    Nitin R
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 02 Apr 2013 Link to this post

    Hi Nitin,

    By default you can zoom-in by dragging a box with the mouse (see scn1.png and scn2.png). Additionally you can zoom-out by attaching to the mouse wheel event of RadCartesianChart and changing Zoom/PanOffset properties of the chart. I have attached a sample project demonstrating that.
     
    Kind regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Nitin Nitin
    Nitin Nitin avatar
    41 posts
    Member since:
    Apr 2010

    Posted 02 Apr 2013 Link to this post

    Thankyou for the reply.

    I had looked at the demo that you sent.
    It works well with zooming but the problem is that it still shows the horizontal scrollbar there.
    Also I cannot pan it just by dragging the mouse.
    You can have a look at this in another 3rd party charting control.
    I want to achieve the functionality using mouse and without showing the scrollbars

    http://goo.gl/lSza0

    Thanks,
    Nitin
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 03 Apr 2013 Link to this post

    Hi Nitin,

    The scrollbars that you see in the previously attached project are showd because a ChartPanZoomBehavior is present. If you remove this behavior you will not see the scrollbars.

    Unfortunately we do not have a built-in feature for neither scroll-to-zoom nor drag-to-pan. We have plans to introduce this with the next Q2 official release (scheduled at the beginning of June). However, I have attached a simple project to demonstrate one possible way to achieve this functionality. Give it a try and see if you can apply this approach to your actual app.

    Kind regards,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top