ComponentOne FlexChart for WinForms
Axis Grid Lines
FlexChart > Working with FlexChart > FlexChart Elements > Axis > Axis Grid Lines

Axis grid lines extend from any vertical or horizontal axis across the plot area of the chart. They are displayed for major and minor units and aligned with major and minor tick marks displayed on the axis. These auxiliary lines form a grid that improves the readability of the chart, especially when you are looking for exact values.

Primarily, axis grid lines are of two types: major grid lines and minor grid lines. The lines perpendicular to major tick marks at major unit intervals are major gridlines, while those perpendicular to minor tick marks at minor unit intervals are minor grid lines.

In FlexChart, major grid lines are controlled by the MajorGrid property, while minor grid lines are controlled by the MinorGrid property. In addition, the appearances of the major and the minor grid lines are controlled by the MajorGridStyle and the MinorGridStyle property respectively.

Using these properties, you can display horizontal as well as vertical grid lines to make the FlexChart data easier to read.

The code below illustrates how to set these properties.

' set the major grid lines for X-axis and Y-axis
FlexChart1.AxisX.MajorGrid = False
FlexChart1.AxisY.MajorGrid = True

' style the grid lines
FlexChart1.AxisX.MajorGridStyle.StrokeColor = System.Drawing.Color.Blue
FlexChart1.AxisY.MajorGridStyle.StrokeColor = System.Drawing.Color.Blue
// set the major grid lines for X-axis and Y-axis
flexChart1.AxisX.MajorGrid = false;
flexChart1.AxisY.MajorGrid = true;

// style the grid lines
flexChart1.AxisX.MajorGridStyle.StrokeColor = System.Drawing.Color.Blue;
flexChart1.AxisY.MajorGridStyle.StrokeColor = System.Drawing.Color.Blue;