Class BOBPieChartBase<TY>
- Namespace
- BlazOrbit.Charts.Components
- Assembly
- BlazOrbit.Charts.dll
Shared rendering pipeline for circular distribution charts. Subclassed by BOBPieChart<TY> (full disc, InnerRadius = 0) and BOBDonutChart<TY> (annulus, InnerRadius ≈ 0.6).
Pie / donut do not have X / Y axes, so this base derives from
BOBChartBase<object, TY> with TX bound to the dummy
object type.
public abstract class BOBPieChartBase<TY> : BOBChartBase<object, TY>, IDataVisualizationFamilyComponent
Type Parameters
TYNumeric type of the slice values.
- Inheritance
-
objectComponentBaseBOBChartBase<object, TY>BOBPieChartBase<TY>
- Implements
- Derived
-
BOBDonutChart<TY>BOBPieChart<TY>
- Inherited Members
Constructors
BOBPieChartBase()
protected BOBPieChartBase()
Properties
ChartTypeNoun
Subclass-specific noun used in BuildAriaLabel() (e.g. "Pie", "Donut") so the screen-reader announcement is accurate.
protected abstract string ChartTypeNoun { get; }
Property Value
- string
InnerRadius
Inner-radius / outer-radius ratio in [0, 1). 0 → full pie. ~0.5–0.7 → donut. ≥1 invalid (clamped to 0.99).
[Parameter]
public double InnerRadius { get; set; }
Property Value
- double
OnSliceClick
Fired when the user clicks a slice. Carries the slice label, raw value, declaration index and the computed percentage.
[Parameter]
public EventCallback<BOBChartSliceClickArgs<TY>> OnSliceClick { get; set; }
Property Value
- EventCallback<BOBChartSliceClickArgs<TY>>
OnSliceHover
Fired when the user hovers a slice (mouseenter). Raised in addition
to the native SVG <title> tooltip.
[Parameter]
public EventCallback<BOBChartSliceHoverArgs<TY>> OnSliceHover { get; set; }
Property Value
- EventCallback<BOBChartSliceHoverArgs<TY>>
Padding
Pixel padding inside the SVG viewport so labels don't bump against the edge. 16px default.
[Parameter]
public double Padding { get; set; }
Property Value
- double
ShowPercentages
When true (default), the slice's percentage is rendered at the
arc's mid-radius. Skipped for slices smaller than 5% to avoid label
collisions.
[Parameter]
public bool ShowPercentages { get; set; }
Property Value
- bool
Slices
The slices rendered by the chart, in declaration order (clockwise from 12 o'clock).
[Parameter]
public IEnumerable<BOBChartSlice<TY>>? Slices { get; set; }
Property Value
- IEnumerable<BOBChartSlice<TY>>
Methods
BuildAriaLabel()
Default ARIA label for the chart's <svg> root. Subclasses
override to inject series / value summaries (improves screen-reader
experience).
protected override string BuildAriaLabel()
Returns
- string
RenderSvg(RenderTreeBuilder)
Concrete charts override this to emit SVG content. The supplied
builder is positioned inside the <svg> root, so
implementations only need to add geometry primitives (lines, paths,
rects, text). Sequence numbers must remain unique within the override.
protected override void RenderSvg(RenderTreeBuilder builder)
Parameters
builderRenderTreeBuilderRender tree builder positioned inside the SVG root.