Zoom and Pinch on graphs is always centered.

Thread is closed for posting
2 posts, 0 answers
  1. Nachiket
    Nachiket avatar
    15 posts
    Member since:
    Jul 2012

    Posted 14 Jul 2014 Link to this post

    I have observed that when I pinch or Zoom using multiple fingers on Chart, the chart zooms in or out at the center rather than the area of the chart where I wanted to zoom in or zoom out. 
    Its pretty evident when you have lot of data across the horizontal axis. For example imagine viewing a picture of a face on the phones photo gallery. Now imagine putting your fingers on the eye and gesture to zoom in but the picture zooms in on the nose. Now you can slide your way back to the eye but then as you zoom in closer the photo centers back to the nose and zooms in closer making the user have to slide back to view the eye.   
    another example in terms of graph. imagine you have graph with datetime horizontal axis and graph is for this month. now the 15th of the month will be at the center. now if I start zooming in by putting the finger on the last day of this month, and kept going. the last day pans out of the graph view and the 15 is still centered. 

    I have used this on the chart control to allow Zooming and Pinching 
    <chart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal"/>
    Please help.

  2. Rosy Topchiyska
    Rosy Topchiyska avatar
    586 posts

    Posted 17 Jul 2014 Link to this post

    Hi Nachiket,

    Thank you for the question.

    You can achieve the desired scenario if you create your custom behavior that inherits from the ChartPanAndZoomBehavior class and overrides its OnGesture(..) method. I have attached a sample project that demonstrates how you can do this.

    I hope this helps.

    Rosy Topchiyska

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top