Class TwPieChart
- Namespace
- TwBlazor.Components
- Assembly
- TwBlazor.dll
A pie chart: slices of a circle sized by each value's share of the whole. Set InnerRadius for a donut chart and Semicircle for a half donut.
public class TwPieChart : TwValueChartBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent, IAsyncDisposable
- Inheritance
-
TwPieChart
- Implements
- Inherited Members
Remarks
Best for a handful of parts. Beyond eight values the smallest are folded into one "Other" slice, and negative or zero values are left out because they have no share to draw.
Constructors
TwPieChart()
public TwPieChart()
Properties
CenterText
Gets or sets text shown in the hole of a donut, for example the total.
[Parameter]
public string? CenterText { get; set; }
Property Value
InnerRadius
Gets or sets the size of the hole in the middle, as a fraction of the radius from 0 (a pie) to 0.9.
[Parameter]
public double InnerRadius { get; set; }
Property Value
Semicircle
Gets or sets whether the chart is drawn as a half circle.
[Parameter]
public bool Semicircle { get; set; }
Property Value
ShowPercentages
Gets or sets whether slices large enough to hold a label show their share.
[Parameter]
public bool ShowPercentages { get; set; }
Property Value
Methods
BuildMarks(ChartSceneBuilder)
Adds the marks, data points and axes for the values.
protected override void BuildMarks(ChartSceneBuilder builder)
Parameters
builderChartSceneBuilderThe builder that collects the scene.