android – How to disable highlight line in MPAndroidChart?-ThrowExceptions

Exception or error:

MPAndroidChart – linechart

enter image description here

how to invisible touching line ?
please help.

How to solve:

Actually its Highlight selected axis.

to remove that use mChart.getData().setHighlightEnabled(false);

setHighlightEnabled : Enables / disables highlighting values for all DataSets this data object contains. If set to true, this means that values can be highlighted programmatically or by touch gesture.


If you have sample of MP Android Lib then you can check it from Option Menu named “Toggle Highlight”.

This can also be found in the documentation.

###

If still want to show marker, and hide those lines, try this. (MPAndroidChart v3.0.0)

dataSet.setDrawHorizontalHighlightIndicator(false); dataSet.setDrawVerticalHighlightIndicator(false);

###

To remove touch lines you can use

dataSet.setDrawHighlightIndicators(false);

To remove individual indicator lines, use either one of following

dataSet.setDrawHorizontalHighlightIndicator(false);
dataSet.setDrawVerticalHighlightIndicator(false);

In this, ‘dataSet’ should be an instance of LineScatterCandleRadarDataSet (LineDataSet extending that class in the inheritance hierarchy)

You do not need to have mpAndroidChart Version 3. I tried this with version 2.1.6

Leave a Reply

Your email address will not be published. Required fields are marked *