Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing grid lines in C# Chart & making thicker graph lines

Tags:

c#

charts

I'm using the built in chart class of .net 4 and I just cant find a way to remove the grid lines on the chart. Is there a way of doing it? And another question, how do I make the graph lines thicker?

Thanks :)

like image 258
Jason Avatar asked Jul 26 '11 08:07

Jason


People also ask

How do I get rid of gridlines?

Select the worksheet. Click the Page Layout tab. To show gridlines: Under Gridlines, select the View check box. To hide gridlines: Under Gridlines, clear the View check box.

What is a gridline?

Definition of grid line : any of a series of numbered horizontal and perpendicular lines that divide a map into squares to form a grid by means of which any point may be located by a system of rectangular coordinates.


2 Answers

Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;

This will remove gridlines from chartarea.

like image 119
nitin Avatar answered Sep 20 '22 23:09

nitin


I believe the line width can be changed using BorderWidth and BorderDashStyle of the series.

For the gridlines, try playing with MajorGrid, MinorGrid, MajorTickMark, MinorTickMark and Interval on the axis.

like image 43
Mark Avatar answered Sep 22 '22 23:09

Mark