Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop highlight when any bar is clicked in MPAndroidChart?

I am using barChart of MPAndroidChart library. My problem is whenever I click any bar of that bar chart its color change something like an overlay. I have tried several techniques but nothing is working. I have tried following codes :

    barChart.setHighlightPerTapEnabled(false);

Upper line do this trick for me but it also disables click event, that means if I set HighlightPerTapEnabled = false then my onValue selected listener does not fire anymore. I also have tried below two lines but nothing is working as my expectation.

    mChart.setTouchEnabled(false);
    mChart.setDrawBarShadow(false);

All i want just to remove this change of color when a user clicks any bar of that barChart. Thanks in Advance.

like image 981
Fazla Elahi Md. Jubayer Avatar asked Dec 03 '22 21:12

Fazla Elahi Md. Jubayer


1 Answers

You just need to disable the HighLight property on BarData

BarData data = new BarData(dataSets);
data.setHighlightEnabled(false);
like image 123
Don Chakkappan Avatar answered Dec 06 '22 11:12

Don Chakkappan