Mpandroidchart: Can't disable pinch to zoom for BarChart

Created on 18 Jan 2017  路  3Comments  路  Source: PhilJay/MPAndroidChart

I have a BarChart and I'm trying to disable scaling.
Seems that these methods doesn't work:
setScaleEnabled(false);
setPinchZoom(false);
setDoubleTapToZoomEnabled(false);
I still can double tap or pinch to zoom. If I set setTouchEnabled(false), it works but in this case I'm losing drag to highlight functionality.

Probably a regression?

Most helpful comment

It appears that the issue is caused by the fact that I called setScaleEnabled inside overridden init() method, which is called before the mScaleXEnabled field is initialized. I moved this logic to onFinishInflate and now it works.

All 3 comments

I used v3.0.1 of MPAndroidChart

It appears that the issue is caused by the fact that I called setScaleEnabled inside overridden init() method, which is called before the mScaleXEnabled field is initialized. I moved this logic to onFinishInflate and now it works.

Hey锛孖 have the same issues "It appears that the issue is caused by the fact that I called setScaleEnabled inside overridden init() method",but I can't find where "the mScaleXEnabled field is initialized"?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

botondbutuza picture botondbutuza  路  3Comments

thanhcly920 picture thanhcly920  路  3Comments

DarkHelmet67 picture DarkHelmet67  路  3Comments

manucheri picture manucheri  路  3Comments

omensight picture omensight  路  3Comments