I've made some graphs in my ASP.Net MVC application using the ASP.Net MSChart control. I cant seem to find the property for hiding the gridlines, anyone know how this is done?
Thanks
To show the gridlines, in Excel, PowerPoint, or Word, click the View tab, and then check the Gridlines box. To hide the gridlines, clear the Gridlines check box.
Grid lines are useful when you need to detect subtle differences between quantitative values that are too far from the baseline. Circumstance 3: Assisting the comparison of values along the categorical scale.
Set the Axis.MajorGrid.Enabled property to false for the x and y axes:
Chart1.ChartAreas["YourChartArea"].AxisX.MajorGrid.Enabled = false;
Chart1.ChartAreas["YourChartArea"].AxisY.MajorGrid.Enabled = false;
Its more simple than above . All you need to do is add the following lines in your aspx pageinside your chartarea , since you are using chart control.
<chartareas>
<asp:ChartArea Name="ChartArea1">
<axisy>
<MajorGrid Enabled ="False" />
</axisy>
<axisx>
<MajorGrid Enabled="false"/>
</axisx>
</asp:ChartArea>
You can also set the Mazor grid line width property to zero to see the same output :-
<chartareas>
<asp:ChartArea Name="ChartArea1">
<axisy>
<MajorGrid LineWidth="0" />
</axisy>
<axisx>
<MajorGrid LineWidth="0"/>
</axisx>
</asp:ChartArea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With