Keeping Aspect Lock for zooming in Android


#1

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?


#2

Hello,

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:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.3.5/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/ShinobiChart.OnGestureListener.html

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:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.3.5/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Axis.html

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

Thanks.

Kai.