⮪ DonutChartView

July 18, 2024 · View on GitHub

A SKCanvasView used to render customisable donut charts.

public class DonutChartView : SKCanvasView, IPadding

Inheritance: Object -> BindableObject -> Element -> NavigableElement -> VisualElement -> View -> SKCanvasView -> DonutChartView

Implements: IPadding

Events

NameTypeDescription
EntryClickedEntryClickEventArgsRaised whenever a segment on the chart is clicked.

Properties

NameTypeBindableDefaultDescription
EntriesSourceIEnumerableAn empty ObservableCollection<object>The source of entry data to be used for rendering the chart. It is expected that these entries be some sort of class with value and label properties.
EntryValuePathstring"Value"The path of the value property (expected to be of type float) to be used for determining each entry's segment size.
EntryLabelPathstring"Label"The path of the label property (expected to be of type string) to be used for a friendly display for each entry.
EntryImageTemplateDataTemplate?nullThe template to be used for rendering the image for each data entry. This template's resulting view is expected to be a FileImageSource.
EntryImageScalefloat0.1fThe scale to apply to the rendered entry image.
EntryColorsColor[]Blue, Green, Yellow, Purple, OrangeThe colors to use for representing each data entry on the chart. These colors will loop if there are more entries than colors.
EntryClickedCommandICommand?nullThe command to be invoked when an entry is clicked. This command will receive an object parameter which represents the clicked entry.
EntrySpacingfloat10fThe spacing to be rendered between each entry segment on the chart. Currently, anything over 20f may produce unexpected results.
PaddingThickness10, 10, 10, 10The padding applied to the entire view.
ChartRotationDegreesfloat90fThe rotation offset to be applied to the chart.
ChartOuterRadiusfloat250fThe radius of the outside ring of the chart.
ChartInnerRadiusfloat125fThe radius of the inside ring of the chart.
LabelStyleLabelStyleLabelStyle.KeyThe style in which to display labels on the chart.
LabelFontFamilystring"Arial"The system font family to be used for rendering label text.
LabelFontColorColorWhiteThe color used for rendering label text.
LabelUseAutoFontColorboolfalseDetermines if each entry's color will be used to render the corresponding label text or not.
LabelFontSizefloat20fThe size used for rendering label text.
LabelKeySpacingfloat10fThe amount of vertical spacing between each label when LabelStyle is set to LabelStyle.Key.
LabelKeyColorOffsetfloat20fThe amount of horizontal spacing between each label and its corresponding color when LabelStyle is set to LabelStyle.Key.
LabelOutsideRadiusfloat50fThe radius from the ChartOuterRadius where entry labels will be rendered when LabelStyle is set to LabelStyle.Outside.