RadControls for WinForms

Unlike all other series, PieSeries do not require axes. They visualize each data point as a pie slices with arc size directly proportional to the magnitude of the raw data point’s value. It is important to note that the pie series are valid only in the context of Pie AreaType. Pie slices represent data in one dimension contrasting with the other series which represent data in two dimensions. Here is an example of how to create a pie chart with pie series populated with data:

Copy[C#]
this.radChartView1.AreaType = ChartAreaType.Pie;
PieSeries series = new PieSeries();
series.DataPoints.Add(new PieDataPoint(50, "Germany"));
series.DataPoints.Add(new PieDataPoint(70, "United States"));
series.DataPoints.Add(new PieDataPoint(40, "France"));
series.DataPoints.Add(new PieDataPoint(25, "United Kingdom"));
series.ShowLabels = true;
this.radChartView1.Series.Add(series);
Copy[VB.NET]
Me.RadChartView1.AreaType = ChartAreaType.Pie
Dim series As New PieSeries()
series.DataPoints.Add(New PieDataPoint(50, "Germany"))
series.DataPoints.Add(New PieDataPoint(70, "United States"))
series.DataPoints.Add(New PieDataPoint(40, "France"))
series.DataPoints.Add(New PieDataPoint(25, "United Kingdom"))
series.ShowLabels = True
Me.RadChartView1.Series.Add(series)

PieSeries can be customized using the following properties:

  • Range - the property consists of two parameters StartAngle and SweepAngle. StartAngle sets the angle in degrees from which the drawing of the pie segments will begin. Note that pie slices are always rendered in counter-clockwise direction. SweepAngle determines if the chart will appear as a full circle or a partial circle. The snippet below illustrates PieSeries how to set the Range property:

    Copy[C#]
    AngleRange range = new AngleRange(270, 300);
    series.Range = range;
    Copy[VB.NET]
    Dim range As New AngleRange(270, 300)
    series.Range = range
  • ShowLabels - the property determines whether the labels above each point will be visible;

  • RadiusFactor - – the property can increase and decrease the diameter of the series. Setting the RadiusFactor to 0.9 will decrease the radius of the series by 10 percent. Similarly, the value 1.1 will increase it. Leaving the property with value 1 will make the donut fill the available space.

  • Additionally, PieSeries allows offsetting a pie segment from the rest of the slices. This is achieved through the OffsetFromCenter property of the individual PieDataPoint. The following snippet demonstrates how to shift the first pie piece:

    Copy[C#]
    PieDataPoint point = series.DataPoints[3] as PieDataPoint;
    if (point != null)
    {
        point.OffsetFromCenter = 0.1;
    }
    Copy[VB.NET]
    Dim point As PieDataPoint = TryCast(series.DataPoints(3), PieDataPoint)
    If point IsNot Nothing Then
        point.OffsetFromCenter = 0.1
    End If