MPAndroidChart hide background grid

Metehan Toksoy picture Metehan Toksoy · Jul 7, 2015 · Viewed 31.9k times · Source

I'm using MPAndroidChart - LineChart in my android application. I want to remove gridlines from the background . How can I remove gridlines from the background?

MPAndroidChart Line Chart Example

Library: MPAndroidChart on GitHub

EDIT: I created my own custom LineChart using this library. I want to remove bottom line. how can I do that too? Custom LineChart

Answer

MightySeal picture MightySeal · Jul 7, 2015

Use this:

mChart.getAxisLeft().setDrawGridLines(false);
mChart.getXAxis().setDrawGridLines(false);

Please note you may need right axis or both of them. It depends on axis you are actually using.

UPDATE: Is it axis line? If it is, then simply chart.getXAxis().setEnabled(false)

Also possible: chart.getAxisLeft().setDrawAxisLine(false)