Telerik UI for Windows 8 XAML

The PieSeries class is used to visualize a single series of data in a pie chart. The sweep of a pie's slices is directly proportional to the magnitude of the data points' values.

Pie Series First Look

Properties

Note

PieSeries class inherits from the ChartSeries class - See the inherited properties.

Properties:

  • DataPoints: Gets the collection of data points associated with the series.

  • ValueBinding: Gets or sets the binding to a property of the data model that will be used to fill the pie slices.

  • AngleRange (double startAngle, double sweepAngle, ChartSweepDirection sweepDirection): Gets or sets the angle range in which the the pie series will be visualied.

    • startAngle: The start angle for the segments.

    • sweepAngle: The sweep angle in which the segments will be arranged. The value must me in the interval [-360, 360].

    • sweepDirection: The direction in which the sweep angle will be measured.

    Pie Series-Sweep Direction
  • HighlightBrush (Brush): Gets or sets the brush used to render the semi-filled ellipse around the series.

  • DefaultSegmentStyle (Style): Gets or sets the style that defines the default appearance of each pie slice.

  • SelectedPointOffset (double): Gets or sets the offset applied to the currently selected point.

    Note

    This value is applied only if the point's OffsetFromCenter property is 0.

  • SegmentStyleSelector: Gets or sets the Style selector instance used to select the style for each PieDataPoint.

  • RadiusFactor (double): Gets or sets the radius factor used to calculate the radius of the visual series. This value is usually within the (0, 1) range but it is possible to oversize the series by setting a value greater than 1.

  • SegmentStyles: Gets the collection storing a Style instance for each segment present on the chart.

  • LegendTitleBinding: Gets or sets the binding to a property from the data model that will be used by any attached legend to display the item's title.

  • IsVisibleInLegendBinding: Gets or sets the binding to a property from the data model that will be used by any attached legend to specify whether to add the item in the legend.

Example

Declare the RadPieChart and the PieSeries:

XAML Copy imageCopy
<telerik:RadPieChart  x:Name="myChart" Width="300" Height="300" ClipToBounds="False" PaletteName="DefaultDark">
    <telerik:PieSeries ShowLabels="True">
        <telerik:PieSeries.ValueBinding>
            <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
        </telerik:PieSeries.ValueBinding>
    </telerik:PieSeries>
</telerik:RadPieChart>

Create sample data.

C# Copy imageCopy
public class Data
{
    public double Value { get; set; }
}

public List<Data> CreateData()
{
    List<Data> data = new List<Data>();
    data.Add(new Data() { Value = 20 });
    data.Add(new Data() { Value = 45 });
    data.Add(new Data() { Value = 35 });
    return data;
}

Pass the sample data to the ItemsSource of the series.

C# Copy imageCopy
this.myChart.Series[0].ItemsSource = CreateData();