menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PieSeries - MAUI 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
    Inherited Members
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.EnableAnimation
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltip
    ChartSeries.EnableTooltipProperty
    ChartSeries.Fill
    ChartSeries.FillProperty
    ChartSeries.GetDataPointIndex(Single, Single)
    ChartSeries.IsVisible
    ChartSeries.IsVisibleOnLegend
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.ItemsSource
    ChartSeries.ItemsSourceProperty
    ChartSeries.LabelContext
    ChartSeries.LabelContextProperty
    ChartSeries.LabelTemplate
    ChartSeries.LabelTemplateProperty
    ChartSeries.LegendIcon
    ChartSeries.LegendIconProperty
    ChartSeries.OnParentSet()
    ChartSeries.Opacity
    ChartSeries.OpacityProperty
    ChartSeries.PaletteBrushes
    ChartSeries.PaletteBrushesProperty
    ChartSeries.SelectionBehavior
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.ShowDataLabels
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.TooltipTemplate
    ChartSeries.TooltipTemplateProperty
    ChartSeries.XBindingPath
    ChartSeries.XBindingPathProperty
    ChartSeries.XRange
    ChartSeries.YRange
    CircularSeries.DataLabelSettings
    CircularSeries.DataLabelSettingsProperty
    CircularSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    CircularSeries.EndAngle
    CircularSeries.EndAngleProperty
    CircularSeries.OnBindingContextChanged()
    CircularSeries.Radius
    CircularSeries.RadiusProperty
    CircularSeries.StartAngle
    CircularSeries.StartAngleProperty
    CircularSeries.Stroke
    CircularSeries.StrokeProperty
    CircularSeries.StrokeWidth
    CircularSeries.StrokeWidthProperty
    CircularSeries.YBindingPath
    CircularSeries.YBindingPathProperty
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class PieSeries : CircularSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon
    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, StrokeWidth, and Radius to customize the appearance.

    EnableTooltip - The tooltip displays information while tapping or mouse hovering on the segment. To display the tooltip on the chart, you need to set the EnableTooltip property as true in PieSeries and 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 ShowDataLabels property as true in the PieSeries class. To customize the chart data labels’ alignment, placement, and label styles, you need to create an instance of CircularDataLabelSettings and set it 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 SelectionBehavior property of the 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 property.

    Examples
    • Xaml
    • C#
    • ViewModel
        <chart:SfCircularChart>
    
              <chart:SfCircularChart.Series>
                  <chart:PieSeries
                      ItemsSource="{Binding Data}"
                      XBindingPath="XValue"
                      YBindingPath="YValue"/>
              </chart:SfCircularChart.Series>  
    
        </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

    Identifies the ExplodeAll bindable property.

    Declaration
    public static readonly BindableProperty ExplodeAllProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ExplodeIndexProperty

    Gets or sets the index value of the segment to be exploded. This is a bindable property.

    Declaration
    public static readonly BindableProperty ExplodeIndexProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ExplodeOnTouchProperty

    Gets or sets the value that indicates whether to explode the segment on touch. This is a bindable property.

    Declaration
    public static readonly BindableProperty ExplodeOnTouchProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    ExplodeRadiusProperty

    Gets or sets the value that defines the exploding distance of the segment. This is a bindable property.

    Declaration
    public static readonly BindableProperty ExplodeRadiusProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    GroupModeProperty

    Identifies the GroupMode bindable property.

    Declaration
    public static readonly BindableProperty GroupModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    GroupToProperty

    Identifies the GroupTo bindable property.

    Declaration
    public static readonly BindableProperty GroupToProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    ExplodeAll

    Gets or sets a value that causes all the data points to explode from the center of the chart.

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

    It accepts bool, and the default is false.

    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 value of the segment 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.

    Remarks

    To explode a segment, create an instance for any circular series, and assign value to the ExplodeIndex property.

    Examples
    • Xaml
        <chart:SfCircularChart>
    
              <chart:SfCircularChart.Series>
                  <chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
                      YBindingPath="YValue" ExplodeIndex = "3"/>
              </chart:SfCircularChart.Series>  
    
        </chart:SfCircularChart>

    ExplodeOnTouch

    Gets or sets a value indicating whether to explode the segment by touch or tap interaction.

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

    This property takes the System.Boolean value, and its default value is false.

    Remarks

    To explode a selected segment by tap action, create an instance for any circular series, and assign the ExplodeOnTouch property value as "True"

    Examples
    • Xaml
       <chart:SfCircularChart>
    
             <chart:SfCircularChart.Series>
                 <chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
                     YBindingPath="YValue" ExplodeOnTouch="True"/>
             </chart:SfCircularChart.Series>  
    
       </chart:SfCircularChart>

    ExplodeRadius

    Gets or sets the value that defines the exploding distance of the segments.

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

    This property takes a System.Double value, and its default value is 10d.

    Remarks

    To explode a segment to a specific length, create an instance for any circular series, and assign value to both ExplodeIndex and ExplodeRadius properties.

    The value needs to be greater than zero.

    Examples
    • Xaml
        <chart:SfCircularChart>
    
              <chart:SfCircularChart.Series>
                  <chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
                      YBindingPath="YValue" ExplodeIndex = "3" ExplodeRadius="20"/>
              </chart:SfCircularChart.Series>  
    
        </chart:SfCircularChart>

    GroupMode

    Gets or sets the group mode, which determines the type of grouping based on slice Angle, actual data point Value, or Percentage.

    Declaration
    public PieGroupMode GroupMode { get; set; }
    Property Value
    Type Description
    PieGroupMode

    This property takes a PieGroupMode value, and its default value is PieGroupMode.Value.

    Remarks

    To specify group mode type based on angle or data point value or percentage, create an instance for pie series, and assign value to GroupTo property.

    Examples
    • Xaml
        <chart:SfCircularChart>
    
                  <chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
                      YBindingPath="YValue" GroupTo="90" GroupMode="Angle"  />
    
        </chart:SfCircularChart>

    GroupTo

    Gets or sets the value that specifies the grouping for segments containing a minimum value of data points below the specified threshold.

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

    This property takes a System.Double value, and its default value is double.NaN.

    Remarks

    To group the segments to a specific value, create an instance for pie series, and assign value to GroupMode property.

    Examples
    • Xaml
        <chart:SfCircularChart>
    
                  <chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
                      YBindingPath="YValue" GroupTo = "30" />
    
        </chart:SfCircularChart>

    Methods

    CreateSegment()

    Declaration
    protected override ChartSegment CreateSegment()
    Returns
    Type
    ChartSegment
    Overrides
    ChartSeries.CreateSegment()

    See Also

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