New to Telerik UI for WinForms? Download free 30-day trial

Gridlines

Gridlines are auxiliary lines that form a grid for easier reading of the chart. Gridlines can be vertical or horizontal. Vertical gridlines are controlled by the XAxis and horizontal gridlines are controlled by YAxis and YAxis2. Gridlines can be "major", e.g. falling on the labeled axis Step values.  "Minor" gridlines appear for YAxis and YAxis2 that fall between Step values. See the figure below where major gridlines fall on 20 and 40 of the YAxis and minor gridlines fall between the major gridlines. 

To control the visibility and general appearance of gridlines use the the PlotArea..Appearance property to reach MajorGridLines and MinorGridlines properties.  XAxis has only MajorGridLines while YAxis and YAxis2 have both MajorGridLines and MinorGridlines properties.  Both major and minor gridline objects include the following properties:

  • Visible

  • Color

  • PenStyle (Solid, Dash, Dot, DashDot, DashDotDot and Custom)

  • Width

In the example below both X axis and Y axis are visible.  XAxis MajorGridLines are red solid lines 3 pixels wide. YAxis MinorGridlines are shown as blue dotted lines 2 pixels wide and YAxis MajorGridLines are shown as blue solid lines 3 pixels wide.

In this article