$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Chart Control for C# Windows Forms
Design Bar, Pie, Line, Area, Polar, ar and Scatter for C# Windows Forms application
Home > WinForms UI Controls > User Manual > Chart Grid in C#

Chart Grid for WinForms C# Tutorial

In the Chart areas, users can render a grid to facilitate the process of configuring the values that control the distance between the points and the axes. The Chart support the Axes. However, the grid is only valid to the context of Cartesian and Polar areas because the Pie area does not use axes. The following tutorial shows how to set up the grid of both areas:

How to Set Cartesian Grid in C#


//use the below C# code to add data to Cartesian Grid
LineSeries series = new LineSeries();
series.DataPoints.Add(new CategoricalDataPoint(1500, "Jan"));
series.DataPoints.Add(new CategoricalDataPoint(1300, "Apr"));
series.DataPoints.Add(new CategoricalDataPoint(800, "Jul"));
series.DataPoints.Add(new CategoricalDataPoint(1000, "Oct"));
this.Chart1.Series.Add(series);

// use the below C# code to setup the Cartesian Grid
CartesianArea area = this.Chart1.GetArea<CartesianArea>();
area.ShowGrid = true;
CartesianGrid grid = area.GetGrid<CartesianGrid>();
grid.DrawHorizontalFills = true;
grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
The following are key properties for the CartesianGrid:
  • BorderForeColor, this is the property used to change the color of the lines that are used to separate grid sectors;
  • BorderDashStyle, this is the property used to set the style of the borders, which includes the following available values, Solid, Dash, Dot, DashDot, DashDotDot, Custom;
  • RenderHStripes, this is the property used to render the horizontal borders of the grid;
  • RenderVStripes, this is the property used to render the vertical borders of the grid;
  • DrawHFills, this is the property used to draw the fills of the horizontal sectors;
  • DrawVFills, this is the property used to draw the fills of the vertical sectors;
  • BackColor, this property is used to set the color of the horizontal sectors;
  • BackColor2, this property is used to set the color of the vertical sectors;
  • AlternativeVColor, this property is used to draw the fill of the alternative vertical sectors;
  • AlternativeBackColor, this property is used to set the color of the fill of the alternative vertical sectors;
  • AlternativeHColor, this is the property used to draw the fill of the alternative horizontal sectors;
  • AlternativeBackColor2, this property is used to set the color of the fill of the alternative horizontal sectors;

How to Set Polar Grid in C#


//use the below C# code to add data to Cartesian Grid
this.Chart1.AreaType = ChartAreaType.Polar;
PolarPointSeries polarPointSeries = new PolarPointSeries();
PolarDataPoint dataPoint = new PolarDataPoint();
dataPoint.Value = 80;
dataPoint.Angle = 30;
polarPointSeries.DataPoints.Add(dataPoint);

dataPoint = new PolarDataPoint();
dataPoint.Value = 100;
dataPoint.Angle = 160;
polarPointSeries.DataPoints.Add(dataPoint);
this.Chart1.Series.Add(polarPointSeries);

// use the below C# code to setup the Polar Grid
PolarArea area = this.Chart1.GetArea<PolarArea>();
area.ShowGrid = true;
PolarGrid grid = area.GetGrid<PolarGrid>();
grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
The following are key properties for the PolarGrid:
  • BorderForeColor, this is the property used to change the color of the lines that are used to separate grid sectors;
  • BorderDashStyle, this is the property used to set the style of the borders and the available values contains Solid, Dash, Dot, DashDot, DashDotDot, Custom;
  • RenderPolarStripes, the property is used for rendering the polar borders of the grid;
  • DrawialStripes, this is the property used to render the Radial borders of the grid;
  • DrawPolarFills, this is the property used to draw the fills of the polar sectors;
  • DrawRadialFills, the property is used for draw the fills of the Radial sectors;
  • BackColor, this is the property used to set the color of the polar sectors;
  • BackColor2, this is the property used to set the color of the Radial sectors;
  • AlternativePolarColor, this is the property used to draw the fill of the alternative polar sectors;
  • AlternativeRadialColor, this is the property used to draw the fill of the alternative Radial sectors;
  • AlternativeBackColor, this is the property used to set the color of the alternative polar sectors;
  • AlternativeBackColor2, this is the property used to set the color of the alternative Radial sectors;
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls