Articles in this section

How to customize axes grid lines in Winforms Chart control?

In WinForms Chart control, grid lines help visually separate axis intervals for better readability. You can customize grid lines on both primary X-axis and primary Y-axis using the following properties.

  • DrawGrid - Enables or disables drawing of grid lines on the chart axis.
  • ForeColor - Sets the foreground color of the grid lines.
  • BackColor - Sets the background color of the grid lines.
  • DashStyle - Defines the dash pattern for the grid lines (e.g., solid, dash, dot).
  • PenType - Specifies the pen type used to draw the grid lines.
  • Width - Determines the thickness of the grid lines.
this.chartControl1 = new ChartControl();
. . .
// Primary X axis grid line customization.
this.chartControl1.PrimaryXAxis.GridLineType.ForeColor = Color.BlanchedAlmond;

this.chartControl1.PrimaryXAxis.GridLineType.Width = 5;

// Disables the Primary Y axis grid line.
this.chartControl1.PrimaryYAxis.DrawGrid = false;
Me.ChartControl1 = New ChartControl()
. . .
' Primary X axis grid line customization.
Me.chartControl1.PrimaryXAxis.GridLineType.ForeColor = Color.BlanchedAlmond
Me.chartControl1.PrimaryXAxis.GridLineType.Width = 5

' Disables the Primary Y axis grid line.
Me.chartControl1.PrimaryYAxis.DrawGrid = false

Output

Conclusion

I hope you enjoyed learning about how to customize axes grid lines in Winforms Chart control.

You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied