I am using multiple mpandroidchart in a scrollview with a linearlayout.
The thing is is i want to disable any kind of horizontal/verical scrolling in the charts because that causes problem when i'm scrolling down to next chart. I've tried setting the clickable attribute to false but that doesn't help. Is there any method in the library to disable any kind of touch event on chart? I would like it to be fully static.
Use the OnChartGestureListener
from library : OnChartGestureListener.
Enabling / disabling interaction
setTouchEnabled(boolean enabled)
: Allows to enable/disable all
possible touch-interactions with the chart.setDragEnabled(boolean enabled)
: Enables/disables dragging (panning)
for the chart.setScaleEnabled(boolean enabled)
: Enables/disables scaling for the
chart on both axes.setScaleXEnabled(boolean enabled)
: Enables/disables scaling on the
x-axis.setScaleYEnabled(boolean enabled)
: Enables/disables scaling on the
y-axis.setPinchZoom(boolean enabled)
: If set to true, pinch-zooming is
enabled. If disabled, x- and y-axis can be zoomed separately.and many more...
Please check this answer Disable OnClickListener while scaling or dragging a View.
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