Category / Section
How to show/hide grid lines in Android Chart?
1 min read
You can show or hide the major and minor grid lines of chart axis using ShowMajorGridLines and ShowMinorGridLines properties of the respective axis. The default value is true for both properties.
Code snippet
[Java]
chart.getPrimaryAxis().setShowMajorGridLines(false); chart.getSecondaryAxis().setShowMajorGridLines(false); chart.getSecondaryAxis().setShowMinorGridLines(false);
Xamarin.Android (C#)
chart.PrimaryAxis.ShowMajorGridLines = false; chart.SecondaryAxis.ShowMajorGridLines = false; chart.SecondaryAxis.ShowMinorGridLines = false;
Output