Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable highlight line in MPAndroidChart?

MPAndroidChart - linechart

enter image description here

how to invisible touching line ?
please help.

like image 242
KI-NAM BANG Avatar asked Feb 11 '16 03:02

KI-NAM BANG


3 Answers

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

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

like image 69
Ting Avatar answered Nov 10 '22 03:11

Ting


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.

like image 35
Dhaval Parmar Avatar answered Nov 10 '22 03:11

Dhaval Parmar


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

like image 26
Sameera Nandasiri Avatar answered Nov 10 '22 02:11

Sameera Nandasiri