PieSeries Class
Represents a pie series for use in a PieChart or DonutChart.
public class PieSeries : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
Constructors
PieSeries()
Initializes an instance of the class.
public PieSeries()
Properties
AreChildLabelsVisible
Gets or sets a value indicating whether child labels are visible or not.
public bool AreChildLabelsVisible { get; set; }
Property Value
- bool:
true
if child labels are visible; otherwise,false
.
AreChildrenVisibleInLegend
Gets or sets a value indicating whether children are visible in the legend or not.
public bool AreChildrenVisibleInLegend { get; set; }
Property Value
- bool:
true
if children are visible in the legend; otherwise,false
.
AreLabelsVisible
Gets or sets a value indicating whether labels are visible or not.
public bool AreLabelsVisible { get; set; }
Property Value
- bool:
true
if labels are visible; otherwise,false
.
ChildLabelBrush
Gets or sets the brush used for child pie slice labels.
public Brush ChildLabelBrush { get; set; }
Property Value
- Brush:
The child label brush.
Remarks
If ChildLabelBrush is not set, then LabelBrush will be used, or Foreground if neither are set.
ChildLabelPosition
Gets or sets the child label position.
public PieSliceLabelPosition ChildLabelPosition { get; set; }
Property Value
- PieSliceLabelPosition:
The child label position.
ChildLabelStyle
Gets or sets the style applied to child pie slice labels. Style should have TargetType of TextBlock.
ChildSliceLabelFormat
Gets or sets the child slice label format.
public string ChildSliceLabelFormat { get; set; }
Property Value
- string:
The child slice label format.
Remarks
This property is ignored if ChildSliceLabelFunc is specified. The label format has three parameters: {0} is the percentage of the child pie slice. {1} is the original value of the child pie slice. {2} is the title of the child pie slice.
ChildSliceLabelFunc
Gets or sets the child slice label func.
public Func<double, object, string, string> ChildSliceLabelFunc { get; set; }
Property Value
Remarks
This is a custom function that takes the pie slice percentage, original value, and title as parameters and returns the label of your choice.
ChildSliceTitlePath
Gets or sets the child slice title path.
public string ChildSliceTitlePath { get; set; }
Property Value
- string:
The child slice title path.
Remarks
This is a path to a property on a value of child items that represents the title of the pie slice.
ChildSliceToolTipFormat
Gets or sets the child slice tooltip format.
public string ChildSliceToolTipFormat { get; set; }
Property Value
- string:
The child slice tooltip format.
Remarks
This property is ignored if ChildSliceToolTipFunc is specified. The tooltip format has three parameters: {0} is the percentage of the child pie slice. {1} is the original value of the child pie slice. {2} is the title of the child pie slice.
ChildSliceToolTipFunc
Gets or sets the child slice tooltip func.
public Func<double, object, string, string> ChildSliceToolTipFunc { get; set; }
Property Value
Remarks
This is a custom function that takes the pie slice percentage, original value, and title as parameters and returns the tooltip of your choice.
ChildSliceValuePath
Gets or sets the child slice value path.
public string ChildSliceValuePath { get; set; }
Property Value
- string:
The child slice value path.
Remarks
This is a path to a property on a value of child items that represents the value of the pie slice.
ChildrenLength
Gets or sets the length of the children.
public double ChildrenLength { get; set; }
Property Value
- double:
The length of the children.
Remarks
Length is the size of children in relation to the other pie series.
ChildrenPath
Gets or sets the children path.
public string ChildrenPath { get; set; }
Property Value
- string:
The children path.
Remarks
This is a path to a property on a value in ItemsSource that is an IEnumerable containing child data.
ChildrenPosition
Gets or sets the children position.
public PieSeriesChildPosition ChildrenPosition { get; set; }
Property Value
- PieSeriesChildPosition:
The children position.
IsOtherThresholdPercent
Gets or sets a value indicating whether this instance is other threshold percent.
public bool IsOtherThresholdPercent { get; set; }
Property Value
- bool:
true
if this instance is other threshold percent; otherwise,false
.
IsVisibleInLegend
Gets or sets a value indicating whether this instance is visible in legend.
public bool IsVisibleInLegend { get; set; }
Property Value
- bool:
true
if this instance is visible in legend; otherwise,false
.
ItemsSource
Gets or sets the items source.
LabelBrush
Gets or sets the brush used for labels.
public Brush LabelBrush { get; set; }
Property Value
- Brush:
The label brush.
Remarks
If LabelBrush is not set, then Foreground will be used instead.
LabelInsideFitMode
Gets or sets the label inside fit mode.
public PieSliceLabelInsideFitMode LabelInsideFitMode { get; set; }
Property Value
- PieSliceLabelInsideFitMode:
The label inside fit mode.
Remarks
This determines how the label reacts when it doesn't fit inside the pie slice.
LabelPosition
Gets or sets the label position.
public PieSliceLabelPosition LabelPosition { get; set; }
Property Value
- PieSliceLabelPosition:
The label position.
LabelStyle
Gets or sets the style applied to pie slice labels. Style should have TargetType of TextBlock.
Length
Gets or sets the size of pie series in relation to the other pie series.
OtherThreshold
Gets or sets the threshold for the "Other" slice.
public double OtherThreshold { get; set; }
Property Value
- double:
The other threshold.
Remarks
If IsOtherThresholdPercent is true
, then this
value represents a percentage between 0.0 and 1.0.
Otherwise, it represents a numerical value.
All values beneath the other threshold will be aggregated into an "Other" pie slice.
SliceLabelFormat
Gets or sets the slice label format.
public string SliceLabelFormat { get; set; }
Property Value
- string:
The slice label format.
Remarks
This property is ignored if SliceLabelFunc is specified. The label format has three parameters: {0} is the percentage of the pie slice. {1} is the original value of the pie slice. {2} is the title of the pie slice.
SliceLabelFunc
Gets or sets the slice label func.
public Func<double, object, string, string> SliceLabelFunc { get; set; }
Property Value
Remarks
This is a custom function that takes the pie slice percentage, original value, and title as parameters and returns the label of your choice.
SliceStyleSelector
Gets or sets the slice style selector, which determines the style used for each pie slice.
public IPieSliceStyleSelector SliceStyleSelector { get; set; }
Property Value
- IPieSliceStyleSelector:
The slice style selector.
SliceTitlePath
Gets or sets the slice title path.
public string SliceTitlePath { get; set; }
Property Value
- string:
The slice title path.
Remarks
This is a path to a property on a value in ItemsSource that represents the value of the pie slice.
SliceToolTipFormat
Gets or sets the slice tooltip format.
public string SliceToolTipFormat { get; set; }
Property Value
- string:
The slice tooltip format.
Remarks
This property is ignored if SliceToolTipFunc is specified. The tooltip format has three parameters: {0} is the percentage of the pie slice. {1} is the original value of the pie slice. {2} is the title of the pie slice.
SliceToolTipFunc
Gets or sets the slice tooltip func.
public Func<double, object, string, string> SliceToolTipFunc { get; set; }
Property Value
Remarks
This is a custom function that takes the pie slice percentage, original value, and title as parameters and returns the tooltip of your choice.
SliceValuePath
Gets or sets the slice value path.
public string SliceValuePath { get; set; }
Property Value
- string:
The slice value path.
Remarks
This is a path to a property on a value in ItemsSource that represents the value of the pie slice.
Methods
FireRefresh()
Fires the Refresh event.
protected void FireRefresh()
OnItemsSourceChanged(IEnumerable, IEnumerable)
Occurs when the ItemsSource value is changed.
protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameter | Type | Description |
---|---|---|
oldValue | IEnumerable | Old value of the ItemsSource property. |
newValue | IEnumerable | New value of the ItemsSource property. |
OnItemsSourceCollectionChanged(object, NotifyCollectionChangedEventArgs)
Handles the CollectionChanged
event of the ItemsSource collection.
protected virtual void OnItemsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
sender | object | The source of the event. |
e | NotifyCollectionChangedEventArgs | The NotifyCollectionChangedEventArgs instance containing the event data. |
Events
Refresh
Occurs when a property on pie series is changed that requires the pie chart to be refreshed.
Fields
AreChildLabelsVisibleProperty
Identifies the AreChildLabelsVisible dependency property. This field is read-only.
public static readonly DependencyProperty AreChildLabelsVisibleProperty
AreChildrenVisibleInLegendProperty
Identifies the AreChildrenVisibleInLegend dependency property. This field is read-only.
public static readonly DependencyProperty AreChildrenVisibleInLegendProperty
AreLabelsVisibleProperty
Identifies the AreLabelsVisible dependency property. This field is read-only.
public static readonly DependencyProperty AreLabelsVisibleProperty
ChildLabelBrushProperty
Identifies the ChildLabelBrush dependency property. This field is read-only.
public static readonly DependencyProperty ChildLabelBrushProperty
ChildLabelPositionProperty
Identifies the ChildLabelPosition dependency property. This field is read-only.
public static readonly DependencyProperty ChildLabelPositionProperty
ChildLabelStyleProperty
Identifies the ChildLabelStyle dependency property. This field is read-only.
public static readonly DependencyProperty ChildLabelStyleProperty
ChildLengthProperty
Identifies the ChildrenLength dependency property. This field is read-only.
public static readonly DependencyProperty ChildLengthProperty
ChildPositionProperty
Identifies the ChildrenPosition dependency property. This field is read-only.
public static readonly DependencyProperty ChildPositionProperty
ChildSliceLabelFormatProperty
Identifies the ChildSliceLabelFormat dependency property. This field is read-only.
public static readonly DependencyProperty ChildSliceLabelFormatProperty
ChildSliceLabelFuncProperty
Identifies the ChildSliceLabelFunc dependency property. This field is read-only.
public static readonly DependencyProperty ChildSliceLabelFuncProperty
ChildSliceTitlePathProperty
Identifies the ChildSliceTitlePath dependency property. This field is read-only.
public static readonly DependencyProperty ChildSliceTitlePathProperty
ChildSliceToolTipFormatProperty
Identifies the ChildSliceToolTipFormat dependency property. This field is read-only.
public static readonly DependencyProperty ChildSliceToolTipFormatProperty
ChildSliceToolTipFuncProperty
Identifies the ChildSliceToolTipFunc dependency property. This field is read-only.
public static readonly DependencyProperty ChildSliceToolTipFuncProperty
ChildValuePathProperty
Identifies the ChildSliceValuePath dependency property. This field is read-only.
public static readonly DependencyProperty ChildValuePathProperty
ChildrenPathProperty
Identifies the ChildrenPath dependency property. This field is read-only.
public static readonly DependencyProperty ChildrenPathProperty
IsOtherThresholdPercentProperty
Identifies the IsOtherThresholdPercent dependency property. This field is read-only.
public static readonly DependencyProperty IsOtherThresholdPercentProperty
IsVisibleInLegendProperty
Identifies the IsVisibleInLegend dependency property. This field is read-only.
public static readonly DependencyProperty IsVisibleInLegendProperty
ItemsSourceProperty
Identifies the ItemsSource dependency property. This field is read-only.
public static readonly DependencyProperty ItemsSourceProperty
LabelBrushProperty
Identifies the LabelBrush dependency property. This field is read-only.
public static readonly DependencyProperty LabelBrushProperty
LabelInsideFitModeProperty
Identifies the LabelInsideFitMode dependency property. This field is read-only.
public static readonly DependencyProperty LabelInsideFitModeProperty
LabelPositionProperty
Identifies the LabelPosition dependency property. This field is read-only.
public static readonly DependencyProperty LabelPositionProperty
LabelStyleProperty
Identifies the LabelStyle dependency property. This field is read-only.
public static readonly DependencyProperty LabelStyleProperty
LengthProperty
Identifies the Length dependency property. This field is read-only.
public static readonly DependencyProperty LengthProperty
OtherThresholdProperty
Identifies the OtherThreshold dependency property. This field is read-only.
public static readonly DependencyProperty OtherThresholdProperty
SliceLabelFormatProperty
Identifies the SliceLabelFormat dependency property. This field is read-only.
public static readonly DependencyProperty SliceLabelFormatProperty
SliceLabelFuncProperty
Identifies the SliceLabelFunc dependency property. This field is read-only.
public static readonly DependencyProperty SliceLabelFuncProperty
SliceStyleSelectorProperty
Identifies the SliceStyleSelector dependency property. This field is read-only.
public static readonly DependencyProperty SliceStyleSelectorProperty
SliceTitlePathProperty
Identifies the SliceTitlePath dependency property. This field is read-only.
public static readonly DependencyProperty SliceTitlePathProperty
SliceToolTipFormatProperty
Identifies the SliceToolTipFormat dependency property. This field is read-only.
public static readonly DependencyProperty SliceToolTipFormatProperty
SliceToolTipFuncProperty
Identifies the SliceToolTipFunc dependency property. This field is read-only.
public static readonly DependencyProperty SliceToolTipFuncProperty
SliceValuePathProperty
Identifies the SliceValuePath dependency property. This field is read-only.
public static readonly DependencyProperty SliceValuePathProperty