Reputation: 73
I am using MPAndroidChart and I want to remove background lines at every interval displayed. Tried with this but no use. dailyTargetChart.setDrawGridBackground(false);
XAxis xl = dailyTargetChart.getXAxis();
xl.setDrawAxisLine(true);
xl.setDrawGridLines(false);
YAxis yl = dailyTargetChart.getAxisLeft();
yl.setDrawAxisLine(true);
yl.setDrawGridLines(true);
YAxis yr = dailyTargetChart.getAxisRight();
yr.setDrawAxisLine(true);
yr.setDrawGridLines(false);
Tried this also but vertical lines are still visible at intervals
Upvotes: 4
Views: 4873
Reputation: 1
Try this It will remove the barchart bar background line.
chart.getXAxis().setDrawGridLines(false); // disable grid lines for the XAxis chart.getAxisLeft().setDrawGridLines(false); // disable grid lines for the left YAxis chart.getAxisRight().setDrawGridLines(false); // disable grid lines for the right YAxis
Upvotes: 0
Reputation: 515
Try this
horizontalBarChart.getXAxis().setEnabled(false);
horizontalBarChart.getAxisLeft().setEnabled(false);
horizontalBarChart.getAxisRight().setEnabled(false);
Upvotes: 10