The grid lines of the axes are displayed on the chart walls. As with ticks, there are major and minor grid lines. Their position is determined by the position of the corresponding tick they represent. The user can show the axis grid lines on more than one chart wall.
Controlling the Display of Grid Lines on Chart Walls
You can control the walls on which grid lines are displayed with the SetMajorShowAtWall and SetMinorShowAtWall methods of the Axis object. For vertical axes, these methods accept only the four vertical walls. For horizontal axes, these methods accept the back, the floor, and the front wall. For the Depth axis, the same methods will accept the left wall, the chart floor, and the right wall. You can also query whether a line is displayed on a particular wall with the GetMajorShowAtWall and GetMinorShowAtWall methods of the Axis object.
The following example disables displaying the major grid lines of the left axis on the back wall (by default the grid lines of the left axis are also displayed on the left wall) and also queries whether SecondaryY axis displays its grid lines on the left wall.
VB.NET | |
---|---|
|
C# | |
---|---|
|
Controlling the Appearance of Grid Lines
Grid lines are displayed as simple lines. The user can obtain the LineProperties objects controlling the appearance of the major and minor grid lines with the MajorGridLine and MinorGridLine properties.
The following code will display the PrimaryY major grid lines with in red, while the minor grid lines will be displayed in blue.
VB.NET | |
---|---|
|
C# | |
---|---|
|
Related Examples
Windows Forms: Axes\General\Gridlines