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.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.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
<chart:SfCircularChart>
<chart:SfCircularChart.Series>
<chart:PieSeries
ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCircularChart.Series>
</chart:SfCircularChart>
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 |
Remarks
The ExplodeAll property controls whether all segments explode outward from the center of the chart.
ExplodeIndexProperty
Identifies the ExplodeIndex bindable property.
Declaration
public static readonly BindableProperty ExplodeIndexProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The ExplodeIndex property determines index value of the segment to be exploded.
ExplodeOnTouchProperty
Identifies the ExplodeOnTouch bindable property.
Declaration
public static readonly BindableProperty ExplodeOnTouchProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The ExplodeOnTouch property indicating whether to explode the segment by touch or tap interaction.
ExplodeRadiusProperty
Identifies the ExplodeRadius bindable property.
Declaration
public static readonly BindableProperty ExplodeRadiusProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The ExplodeRadius property defines the exploding distance of the segments.
GroupModeProperty
Identifies the GroupMode bindable property.
Declaration
public static readonly BindableProperty GroupModeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The GroupMode property which determines the type of grouping based on slice Angle, actual data point Value, or Percentage.
GroupToProperty
Identifies the GroupTo bindable property.
Declaration
public static readonly BindableProperty GroupToProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The GroupTo property specifies the grouping for segments containing a minimum value of data points below the specified threshold.
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 |
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
ExplodeAll = "True"/>
</chart:SfCircularChart>
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 |
Remarks
To explode a segment, create an instance for any circular series, and assign value to the ExplodeIndex property.
Examples
<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 |
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
<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 |
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
<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 |
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
<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 |
Remarks
To group the segments to a specific value, create an instance for pie series, and assign value to GroupMode property.
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}" XBindingPath="XValue"
YBindingPath="YValue" GroupTo = "30" />
</chart:SfCircularChart>
Methods
CreateSegment()
Creates and initializes a new chart segment for the chart.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type |
---|
ChartSegment |