I m coding a line chart using MPAndroidChart, my code works without any error but pinch zooming goes to infinity, because of that in some devices CPU has 100%. How can i restrict max pinch zoom?
The mpandroidhchart developer implemented this in this commit: https://github.com/PhilJay/MPAndroidChart/commit/ba152072a6a7adbf8e9e166904798219c1200172
But I'm still waiting for a new release version. Further, you just need to call
chart.getViewPortHandler().setMaximumScaleX(2f);
chart.getViewPortHandler().setMaximumScaleY(2f);
And this will limit the zoom in factor 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With