23
votes

I want to disable pinch zoom at barchart in MPAndroidChart library how i can do that.

library.barchart.setpinzoomenable(false); 

also not working.

4

4 Answers

68
votes

Try this,

Disable all zooming:

chart.setScaleEnabled(false);

More info refer here

3
votes

Marker will continue to work but zoom will be disable

chart.setTouchEnabled(true)
chart.setPinchZoom(false)
chart.isDoubleTapToZoomEnabled = false
1
votes

Try below:

  library.barchart.setPinchZoom(false);
0
votes

Since no one has included anything about axis wise scaling after turning off zooming (as per the latest library), the following lines will disable pinch to zoom as well as x,y-scaling whatsoever:

barChart.setPinchZoom(false)
barChart.setScaleEnabled(false)