1- # Breakdown
1+ # BreakdownChart
22
3- ` Breakdown ` renders a segmented proportional bar (a “breakdown”) with an optional legend. It is useful for showing how
3+ ` BreakdownChart ` renders a segmented proportional bar (a “breakdown”) with an optional legend. It is useful for showing how
44a total value is distributed across categories (disk usage, budgets, KPIs, resource usage, etc.).
55
66> Screenshots: TODO
77
88## Basic usage
99
1010``` csharp
11- var breakdown = new Breakdown ()
11+ var breakdown = new BreakdownChart ()
1212 .Title (" Disk usage" )
1313 .ShowValues (true )
1414 .ShowPercentages (true )
@@ -20,18 +20,18 @@ var breakdown = new Breakdown()
2020
2121## Segments
2222
23- Segments are stored in ` Breakdown .Segments` as ` BreakdownSegment ` objects.
23+ Segments are stored in ` BreakdownChart .Segments` as ` BreakdownSegment ` objects.
2424
2525- ` BreakdownSegment.Value ` : numeric value used to compute proportions.
2626- ` BreakdownSegment.Label ` : a visual shown in the legend (use a ` TextBlock ` , ` Markup ` , an ` HStack ` with an icon, etc.).
2727- ` BreakdownSegment.Color ` : optional segment fill color; when not provided, the control cycles through theme tones.
2828- ` BreakdownSegment.Tooltip ` : optional tooltip content shown when hovering the segment in the bar.
2929
30- For convenience, you can append segments fluently using ` BreakdownExtensions .Segment(...)` as shown above.
30+ For convenience, you can append segments fluently using ` BreakdownChartExtensions .Segment(...)` as shown above.
3131
3232## Interaction
3333
34- ` Breakdown ` raises a routed ` SegmentClicked ` event when the user clicks a segment:
34+ ` BreakdownChart ` raises a routed ` SegmentClicked ` event when the user clicks a segment:
3535
3636``` csharp
3737breakdown .SegmentClicked ((_ , e ) =>
@@ -42,16 +42,18 @@ breakdown.SegmentClicked((_, e) =>
4242
4343## Layout
4444
45- - ` Breakdown .Title` : optional title shown above the bar.
46- - ` Breakdown .LegendPlacement` : ` Above ` or ` Below ` (default: ` Below ` ).
47- - ` Breakdown .ShowValues` / ` Breakdown .ShowPercentages` : controls legend value display.
45+ - ` BreakdownChart .Title` : optional title shown above the bar.
46+ - ` BreakdownChart .LegendPlacement` : ` Above ` or ` Below ` (default: ` Below ` ).
47+ - ` BreakdownChart .ShowValues` / ` BreakdownChart .ShowPercentages` : controls legend value display.
4848
4949## Styling
5050
51- ` Breakdown ` is styled via ` BreakdownStyle ` :
51+ ` BreakdownChart ` is styled via ` BreakdownStyle ` :
5252
5353- ` FillRune ` : rune used to fill the bar (default is a space with colored backgrounds).
5454- ` SegmentGap ` : number of empty cells between segments.
55+ - ` LegendLayout ` : compact (wrap) or expanded (one item per line).
56+ - ` LegendItemSpacing ` : spacing between legend items when using the compact layout.
5557- ` BarStyle ` : optional base style applied to bar cells.
5658- ` DefaultSegmentColors ` : optional palette used when a segment does not provide an explicit ` Color ` .
5759
@@ -63,4 +65,3 @@ breakdown.Style(new BreakdownStyle
6365 SegmentGap = 0 ,
6466});
6567```
66-
0 commit comments