Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove grid lines behind the bars in HorizontalBarChart?

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

like image 852
Vijay Sharma Avatar asked Jan 05 '23 09:01

Vijay Sharma


1 Answers

Try this

 horizontalBarChart.getXAxis().setEnabled(false);
 horizontalBarChart.getAxisLeft().setEnabled(false);
 horizontalBarChart.getAxisRight().setEnabled(false);
like image 86
masp Avatar answered Jan 13 '23 16:01

masp