Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove grid lines from Winforms Chart

Tags:

c#

.net

How can I remove chart grid lines in a System.Windows.Forms.DataVisualization.Charting chart?

like image 875
Błażej Avatar asked Mar 07 '12 08:03

Błażej


People also ask

How do I remove the grid from my chart?

Click anywhere on the chart in which you want to hide chart gridlines. On the Layout tab, in the Axes group, click Gridlines. Do one or more of the following: Click Primary Horizontal Gridlines, Primary Vertical Gridlines, or Depth Gridlines (on a 3-D chart), and then click None.

How do you make a line graph in Winforms?

Right click the FlexChart control on form to open the Properties window. Navigate to the ChartType property and set its value to Line to create a simple line chart. Set the data source using the DataSource property. Configure X-axis and Y-axis values by setting the BindingX and Binding property respectively.


1 Answers

you need to set the MajorGrid and MinorGrid property for the respective axis to false.

like chartArea.AxisX.MajorGrid.Enabled = false;

if you mean how to specify in the mark up then under chart areas

<asp:ChartArea .....
    <AxisX ><MajorGrid Enabled="false" /><MinorGrid Enabled="false" /></AxisX>
    <AxisY><MajorGrid Enabled="false" /><MinorGrid Enabled="false" /></AxisY>
</asp:ChartArea>
like image 168
V4Vendetta Avatar answered Sep 17 '22 20:09

V4Vendetta