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.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public class PieSeries : CircularSeries, ISegmentSelectable
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, StrokeThickness, 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 ShowDataLabels 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 SelectionBehavior 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
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
</chart:SfCircularChart>
Constructors
PieSeries()
Initializes a new instance of the PieSeries class.
Declaration
public PieSeries()
Fields
SelectionBehaviorProperty
The DependencyProperty for SelectionBehavior property. .
Declaration
public static readonly DependencyProperty SelectionBehaviorProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
Properties
Segment
Declaration
public PieSegment Segment { get; }
Property Value
Type | Description |
---|---|
PieSegment |
SelectionBehavior
Gets or sets a selection behavior that enables you to select or highlight a segment in the series.
Declaration
public DataPointSelectionBehavior SelectionBehavior { get; set; }
Property Value
Type | Description |
---|---|
DataPointSelectionBehavior | This property takes the aDataPointSelectionBehavior instance as a value, and its default value is null. |
Remarks
To highlight the selected data point, set the value for the SelectionBrush property in the DataPointSelectionBehavior class.
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:PieSeries.SelectionBehavior>
<chart:DataPointSelectionBehavior SelectionBrush = "Red" />
</chart:PieSeries.SelectionBehavior>
</chart:PieSeries>
</chart:SfCircularChart>