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

Zoom and Pinch on graphs is always centered.

1 Answer 46 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nachiket
Top achievements
Rank 1
Nachiket asked on 14 Jul 2014, 06:05 PM
Hi,
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.

Thanks
Nachiket

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 17 Jul 2014, 02:53 PM
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.

Regards,
Rosy Topchiyska
Telerik
 

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.

 
Tags
Chart
Asked by
Nachiket
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or