Keeping Aspect Lock for zooming in Android


I’m trying to keep the aspect locked while zooming in on a linechart. On iOS there is:

_chart.gesturePinchAspectLock = true;

How can the equivelent be done for Android?



Thanks for your enquiry.

I can advise that currently, the aspect ratio for zooming cannot be directly locked using the ShinobiCharts for Android api.

I can advise however that the api does offer an interface called ShinobiChart.OnGestureListener. Please find a link to the api docs for this interface below:

It may be possible to intercept zoom (pinch) gestures using this interface, and control the zoom for each axis, to create a locked aspect ratio. You would also need to utilise some of the methods on the axis object, such as requestCurrentDisplayedRange and getCurrentDisplayedRange. Please see a link to the ShinobiCharts for Android Axis api below:

I hope that you find this information useful. If you have any further queries, please do not hesitate to get back in touch.