How to limit pinch-and-zoom in Xamarin
Posted: Tue Feb 14, 2017 3:01 pm
We have a chart with a logaritmic scale. We would like to limit the smallest and the largest value for each axis, i.e. not letting the user scroll or zoom to see values smaller than 0.1 or larger than 10,000,000 (Our logaritmic base is 10).
We have managed to limit scrolling by listening to the Chart.Scroll event and manually setting the Axis.Minium or Axis.Maximum if the user scoll past the limits. But trying to do the same thing with pinch-n-zoom doesn't work since the Chart.Zoomed event isn't raised until the user lift their fingers.
Is there a way to either set limits on the axes themselves or only allow zooming in from default view (showing a subset of what was originally displayed) but not zooming out (showing more than was originally displayed)?
We have managed to limit scrolling by listening to the Chart.Scroll event and manually setting the Axis.Minium or Axis.Maximum if the user scoll past the limits. But trying to do the same thing with pinch-n-zoom doesn't work since the Chart.Zoomed event isn't raised until the user lift their fingers.
Is there a way to either set limits on the axes themselves or only allow zooming in from default view (showing a subset of what was originally displayed) but not zooming out (showing more than was originally displayed)?