BreakdownChartWidget<T>
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A widget that displays a proportional segmented bar.
public sealed record BreakdownChartWidget<T> : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<BreakdownChartWidget<T>>Inheritance
Object → Hex1bWidget → BreakdownChartWidget<T>
Implements
Properties
Data
Gets the data source for the chart.
Returns: IReadOnlyList<<T>>
public IReadOnlyList<T>? Data { get; init; }Methods
Label(Func<T, string>)
Sets the function that extracts a segment label from each data item.
Parameters:
selector(Func<<T>, String>):
Returns: BreakdownChartWidget`1
public BreakdownChartWidget<T> Label(Func<T, string> selector)Title(string)
Sets the chart title displayed above the bar.
Parameters:
title(String):
Returns: BreakdownChartWidget`1
public BreakdownChartWidget<T> Title(string title)Value(Func<T, double>)
Sets the function that extracts the numeric value from each data item.
Parameters:
selector(Func<<T>, Double>):
Returns: BreakdownChartWidget`1
public BreakdownChartWidget<T> Value(Func<T, double> selector)Remarks
BreakdownChartWidget always shows proportional data (100% of the total). Each segment's width is proportional to its value relative to the sum of all values.
Unlike and , this widget only supports a single series — no grouped or stacked modes.
Use to display a legend alongside this chart.
Examples
ctx.BreakdownChart([new("Data", 42), new("Packages", 18), new("Temp", 9)])
.Title("Disk Usage")
ctx.Legend([new("Data", 42), new("Packages", 18), new("Temp", 9)])
.ShowPercentages()