Articles in this section
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

C:\Users\yuvaraj.palanisamy\Pictures\android2.png

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied