4

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

Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
Vijay Sharma
  • 73
  • 2
  • 6
  • You mean this http://stackoverflow.com/a/31263332/6774854 ? – masp Sep 15 '16 at 07:52
  • Yes both horizontal and vertical lines behind the bars – Vijay Sharma Sep 15 '16 at 08:20
  • 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); have tried with all these but still vertical lines are visible – Vijay Sharma Sep 15 '16 at 08:22
  • At intervals? You mean during animation or user input? – masp Sep 15 '16 at 08:48
  • after animation ,after values are assigned intervals means the labels which are seen on the axis lines like example 100,200,300 – Vijay Sharma Sep 16 '16 at 05:02

2 Answers2

10

Try this

 horizontalBarChart.getXAxis().setEnabled(false);
 horizontalBarChart.getAxisLeft().setEnabled(false);
 horizontalBarChart.getAxisRight().setEnabled(false);
masp
  • 515
  • 1
  • 5
  • 15
0

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