menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PieSeries - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PieSeries

    The PieSeries displays data as a proportion of the whole. Its most commonly used to make comparisons among a set of given data.

    Inheritance
    System.Object
    ChartSeries
    CircularSeries
    PieSeries
    DoughnutSeries
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    ChartSeries.ActualXAxis
    ChartSeries.ActualYAxis
    ChartSeries.AnimationDuration
    ChartSeries.AnimationDurationProperty
    ChartSeries.Chart
    ChartSeries.EnableAnimation
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltip
    ChartSeries.EnableTooltipProperty
    ChartSeries.Fill
    ChartSeries.FillProperty
    ChartSeries.IsSeriesVisible
    ChartSeries.IsSeriesVisibleProperty
    ChartSeries.IsVisibleOnLegend
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.ItemsSource
    ChartSeries.ItemsSourceProperty
    ChartSeries.Label
    ChartSeries.LabelProperty
    ChartSeries.LegendIcon
    ChartSeries.LegendIconProperty
    ChartSeries.LegendIconTemplate
    ChartSeries.LegendIconTemplateProperty
    ChartSeries.ListenPropertyChange
    ChartSeries.ListenPropertyChangeProperty
    ChartSeries.OnPointerExited(PointerRoutedEventArgs)
    ChartSeries.OnPointerMoved(PointerRoutedEventArgs)
    ChartSeries.OnPointerPressed(PointerRoutedEventArgs)
    ChartSeries.OnPointerReleased(PointerRoutedEventArgs)
    ChartSeries.OnTapped(TappedRoutedEventArgs)
    ChartSeries.PaletteBrushes
    ChartSeries.PaletteBrushesProperty
    ChartSeries.PropertyChanged
    ChartSeries.ResumeNotification()
    ChartSeries.SelectionBehavior
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.ShowDataLabels
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.SpacingProperty
    ChartSeries.SuspendNotification()
    ChartSeries.TooltipTemplate
    ChartSeries.TooltipTemplateProperty
    ChartSeries.TrackballLabelTemplate
    ChartSeries.TrackballLabelTemplateProperty
    ChartSeries.XBindingPath
    ChartSeries.XBindingPathProperty
    CircularSeries.DataLabelSettings
    CircularSeries.DataLabelSettingsProperty
    CircularSeries.EndAngle
    CircularSeries.EndAngleProperty
    CircularSeries.GroupMode
    CircularSeries.GroupModeProperty
    CircularSeries.GroupTo
    CircularSeries.GroupToProperty
    CircularSeries.OnApplyTemplate()
    CircularSeries.Radius
    CircularSeries.RadiusProperty
    CircularSeries.StartAngle
    CircularSeries.StartAngleProperty
    CircularSeries.Stroke
    CircularSeries.StrokeProperty
    CircularSeries.StrokeWidth
    CircularSeries.StrokeWidthProperty
    CircularSeries.YBindingPath
    CircularSeries.YBindingPathProperty
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class PieSeries : CircularSeries, INotifyPropertyChanged
    Remarks

    To render a series, create an instance of the pie series class, and add it to the Series collection.

    It Provides options for PaletteBrushes, Fill, Stroke, , and Radius to customize the appearance.

    EnableTooltip - Tooltips display information while tapping or mouse hovering over the segment. To display the tooltip on the chart, you need to set the EnableTooltip property as true in the PieSeries, and also refer to the TooltipBehavior property.

    Data Label - Data labels are used to display values related to a chart segment. To render the data labels, you need to set the property as true in the PieSeries class. To customize the chart data labels alignment, placement and label styles, need to create an instance of CircularDataLabelSettings and set to the DataLabelSettings property.

    Animation - To animate the series, set True to the EnableAnimation property.

    Selection - To enable the data point selection in the series, create an instance of the DataPointSelectionBehavior and set it to the property of pie series. To highlight the selected segment, set the value for the SelectionBrush property in the DataPointSelectionBehavior class.

    LegendIcon - To customize the legend icon using the LegendIcon, and LegendIconTemplate properties.

    Examples
    • Xaml
    • C#
    • ViewModel
        <chart:SfCircularChart>
    
            <chart:PieSeries ItemsSource="{Binding Data}"
                             XBindingPath="XValue"
                             YBindingPath="YValue"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
    
        ViewModel viewModel = new ViewModel();
    
        PieSeries series = new PieSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
        public ObservableCollection<Model> Data { get; set; }
    
        public ViewModel()
        {
           Data = new ObservableCollection<Model>();
           Data.Add(new Model() { XValue = 10, YValue = 100 });
           Data.Add(new Model() { XValue = 20, YValue = 150 });
           Data.Add(new Model() { XValue = 30, YValue = 110 });
           Data.Add(new Model() { XValue = 40, YValue = 230 });
        }

    Constructors

    PieSeries()

    Initializes a new instance of the PieSeries class.

    Declaration
    public PieSeries()

    Fields

    ExplodeAllProperty

    The DependencyProperty for ExplodeAll property.

    Declaration
    public static readonly DependencyProperty ExplodeAllProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ExplodeIndexProperty

    The DependencyProperty for ExplodeIndex property.

    Declaration
    public static readonly DependencyProperty ExplodeIndexProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ExplodeOnTapProperty

    The DependencyProperty for ExplodeOnTap property.

    Declaration
    public static readonly DependencyProperty ExplodeOnTapProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ExplodeRadiusProperty

    The DependencyProperty for ExplodeRadius property.

    Declaration
    public static readonly DependencyProperty ExplodeRadiusProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    ExplodeAll

    Gets or sets a value indicating whether to explode all the pie slices (segments).

    Declaration
    public bool ExplodeAll { get; set; }
    Property Value
    Type Description
    System.Boolean

    True, will explode all the segments.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:PieSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               ExplodeAll = "True"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        PieSeries series = new PieSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ExplodeAll = true,
        };
    
        chart.Series.Add(series);

    ExplodeIndex

    Gets or sets the index of segment in series to be exploded.

    Declaration
    public int ExplodeIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    This property takes an System.Int32 value, and its default value is -1.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:PieSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               ExplodeIndex = "2"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        PieSeries series = new PieSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ExplodeIndex = 2,
        };
    
        chart.Series.Add(series);

    ExplodeOnTap

    Gets or sets a value indicating whether segment slices will explode on mouse click or tap.

    Declaration
    public bool ExplodeOnTap { get; set; }
    Property Value
    Type Description
    System.Boolean

    if true, the segment will explode on click or tap.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:PieSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               ExplodeOnTap = "True"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        PieSeries series = new PieSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ExplodeOnTap = true,
        };
    
        chart.Series.Add(series);

    ExplodeRadius

    Gets or sets a value that can be used to define the radial distance for the exploded segment from the center.

    Declaration
    public double ExplodeRadius { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts double values, and the default value is 30.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:PieSeries ItemsSource="{Binding Data}"
                              XBindingPath="XValue"
                              YBindingPath="YValue"
                              ExplodeRadius = "50"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        PieSeries series = new PieSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ExplodeRadius = 50,
        };
    
        chart.Series.Add(series);

    Segment

    Declaration
    public PieSegment Segment { get; }
    Property Value
    Type
    PieSegment

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    DoughnutSegment
    DoughnutSeries
    PieSegment
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved