27

MPAndroidChart - linechart

enter image description here

how to invisible touching line ?
please help.

Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
KI-NAM BANG
  • 285
  • 1
  • 4
  • 7
  • setDrawGridLines(boolean enabled): Set this to true to enable drawing the grid lines for the axis – Dhaval Parmar Feb 11 '16 at 04:00
  • @DhawalSodhaParmar try to setDrawGridLines(false); this method is not success. I'm try lineChart.getXAxis().setDrawGridLines(false); lineChart.getAxisLeft().setDrawGridLines(false); lineChart.getXAxis().setDrawGridLines(false); lineChart.getAxisRight().setDrawGridLines(false); lineChart.setDrawGridBackground(false); --- All fail. more solution? – KI-NAM BANG Feb 11 '16 at 04:10

3 Answers3

49

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

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

Ting
  • 639
  • 5
  • 7
34

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.

Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
Dhaval Parmar
  • 18,812
  • 8
  • 82
  • 177
27

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