# PieSeries

This series is visualized on the screen as a circle constructed with separate pie slices representing each of the data points.

* [Declaratively Defined Series](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#declaratively-defined-series)
* [Properties](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#properties)
* [Data Binding](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#data-binding)
* [Setting the Pie Radius](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#setting-the-pie-radius)
* [Offset Pie Slice from Center](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#offset-pie-slice-from-center)
* [Styling the Series](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/piechart-series/pieseries#styling-the-series)

## Declaratively defined series

You can use the following definition to display a simple PieSeries:

**Example 1: Declaring an PieSeries in XAML**

```XAML
<telerik:RadPieChart Palette="Windows8">
    <telerik:RadPieChart.Series>
        <telerik:PieSeries>
            <telerik:PieSeries.DataPoints>
                <telerik:PieDataPoint Label="43.46%" Value="43.46"/>
                <telerik:PieDataPoint Label="27.53%" Value="27.53"/>
                <telerik:PieDataPoint Label="15.11%" Value="15.11"/>
                <telerik:PieDataPoint Label="10.35%" Value="10.35"/>
                <telerik:PieDataPoint Label="3.55%" Value="3.55"/>
            </telerik:PieSeries.DataPoints>
        </telerik:PieSeries>
    </telerik:RadPieChart.Series>
</telerik:RadPieChart>
```

> caption PieSeries visual appearance

![Telerik UI for WPF RadChartView PieSeries visual appearance](https://www.telerik.com/products/wpf/documentation/assets/94af227c95584787b49ed4cca4a630ec/radchartview-series-pieseries.png)

## Properties

* **ValueBinding**: A property of type **DataPointBinding** that gets or sets the property path that determines the value of the data point.
* **AngleRange**: A property of type **DataPointBinding** that gets or sets the property path that determines the category value of the data point.
* **RadiusFactor**: A property of type **double** that gets or sets the radius factor used to calculate the radius of the visual series.
* **SelectedPointOffset**: A property of type **double** that gets or sets the offset applied to a **Telerik.Charting.PieDataPoint** which is currently selected. This value is applied only if the point's OffsetFromCenter property is 0.
* **DefaultSliceStyle**: A property of type **Style** that gets the style applied to every segment in the series.

## Data Binding

You can use the **ValueBinding** property of the PieSeries to bind the DataPoints’ properties to the properties from your view models.

**Example 2: Defining the view model**

```C#
public class PlotInfo
{
    public double Value { get; set; }
}

void SetDataContext()
{
    //.......
    this.DataContext = new ObservableCollection<PlotInfo>
    {
        new PlotInfo() { Value = 43.46},
    	//....
    };
}
```

**Example 3: Specify a PieSeries in XAML**

```XAML
<telerik:PieSeries ItemsSource="{Binding}" ValueBinding="PieValue" />
```

> See the [Create Data-Bound Chart](https://www.telerik.com/products/wpf/documentation/controls/radchartview/populating-with-data/series-databinding) for more information on data binding in the RadChartView suite.

## Setting the Pie Radius

The radius of the pie can be set via the **RadiusFactor** property of the series. The property works in relative units between 0 and 1. Value of 0.3 means that the pie visual will take 30% of the chart's available space.

Setting the property to 1 means that the circle (pie) will take all the available space given from the chart control.

Setting the property to 0.5 means that the circle (pie) will take half of the available space given from the chart control.

Setting the property to a value bigger than 1 (ex: 1.4) will make the pie bigger than the available size.

The default value of the property is 0.85

**Example 4: Setting RadiusFactor**

```XAML
<telerik:PieSeries RadiusFactor="0.4" />
```

> caption RadiusFactor of 1 (left) and 0.4 (right)

![Telerik UI for WPF RadChartView PieSeries with labels](https://www.telerik.com/products/wpf/documentation/assets/0e8b88b5ed7a84a06e01d1da02b37166/radchartview-series-pieseries-1.png)

## Offset Pie Slice from Center

The PieSeries allows you to offset each pie slice from the center of the pie. To do this set the **OffsetFromCenter** property of the corresponding PieDataPoint.

**Example 5: Offsetting pie slices**

```XAML
<telerik:RadPieChart Palette="Windows8">
    <telerik:RadPieChart.Series>
        <telerik:PieSeries>
            <telerik:PieSeries.DataPoints>
                <telerik:PieDataPoint Label="43.46%" Value="43.46"/>
                <telerik:PieDataPoint Label="27.53%" Value="27.53"/>
                <telerik:PieDataPoint Label="15.11%" Value="15.11" OffsetFromCenter="0.2"/>
                <telerik:PieDataPoint Label="10.35%" Value="10.35" OffsetFromCenter="0.2"/>
                <telerik:PieDataPoint Label="3.55%" Value="3.55"/>
            </telerik:PieSeries.DataPoints>
        </telerik:PieSeries>
    </telerik:RadPieChart.Series>
</telerik:RadPieChart>
```

> caption Exploding pie slices

![Telerik UI for WPF RadChartView PieSeries with slices offset](https://www.telerik.com/products/wpf/documentation/assets/4c76afde3bfe2646bcaa3fa3f0ca1704/radchartview-series-pieseries-2.png)

Additionally, you can define the offset for the selected PieDataPoint objects, via the **SelectedPointOffset** property of PieSeries. In this case when you select a data point, the correspondign pie slice will *explode* from the center of the pie.

**Example 6: Setting SelectedPointOffset**

```XAML
<telerik:RadPieChart Palette="Windows8">
    <telerik:RadPieChart.Series>
        <telerik:PieSeries SelectedPointOffset="0.32" RadiusFactor="0.7">
            <telerik:PieSeries.DataPoints>
                <telerik:PieDataPoint Label="43.46%" Value="43.46"/>
                <telerik:PieDataPoint Label="27.53%" Value="27.53"/>
                <telerik:PieDataPoint Label="15.11%" Value="15.11" />
                <telerik:PieDataPoint Label="10.35%" Value="10.35" />
                <telerik:PieDataPoint Label="3.55%" Value="3.55" />
            </telerik:PieSeries.DataPoints>
        </telerik:PieSeries>
    </telerik:RadPieChart.Series>
    <telerik:RadPieChart.Behaviors>
        <telerik:ChartSelectionBehavior />
    </telerik:RadPieChart.Behaviors>
</telerik:RadPieChart>
```

> caption Selected exploding pie slices

![Telerik UI for WPF RadChartView PieSeries with customized slice styling](https://www.telerik.com/products/wpf/documentation/assets/faadc50d0a685d3f5cac67d589b23a34/radchartview-series-pieseries-3.png)

> The OffsetFromCenter and SelectedPointOffset works in relative units between 0 and 1.

## Styling the Series

You can see how to style the series using different properties in the [PieSeries section](https://www.telerik.com/products/wpf/documentation/controls/radchartview/styles-and-templates/customizing-piechart-series) of the Customizing PieChart Series help article.

Additionally, you can use the Palette property of the chart to change the colors of the PieSeries on a global scale. You can find more information about this feature in the [Palettes](https://www.telerik.com/products/wpf/documentation/controls/radchartview/features/palettes/introduction) section in our help documentation.

## See Also

* [Chart Series Overview](https://www.telerik.com/products/wpf/documentation/controls/radchartview/series/chartseries)
* [Create Data-Bound Chart](https://www.telerik.com/products/wpf/documentation/controls/radchartview/populating-with-data/series-databinding)
