Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart: How do I remove gridlines?

In my LineChart beside the lines that are shown on the full numbers parallel to the x-axis, many horizontal gridlines are shown:

enter image description here

enter image description here

How can I get rid of these lines?

like image 930
Code Pope Avatar asked Dec 03 '22 22:12

Code Pope


1 Answers

Those look like axis lines. You can toggle the axis lines by calling setDrawGridLines(false) on each Chart axis. For example, to clear all of them simply do something like this.

LineChart myChart = ...;
myChart.getXAxis().setDrawGridLines(false);
myChart.getAxisLeft().setDrawGridLines(false);
myChart.getAxisRight().setDrawGridLines(false);
like image 139
Chris Stillwell Avatar answered Feb 04 '23 02:02

Chris Stillwell