API Reference
StackedBar
One bar split into proportional segments with a legend (label, value, share). Segments labelled with a status word (Passed, Failed, Warnings, Skipped...) take that status colour unless a token is given. Without colour, segments use distinct fill glyphs so the split stays readable. Live operations (Key = segment): set (Value), add (Value).
Inheritance
- LiveWidget
- StackedBar
Usage
Explore 21 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 11
- Extension method StackedBar.WithCountColumn
- Extension method StackedBar.WithLabelColumn
- Extension method StackedBar.WithMaxLegendColumns
- Extension method StackedBar.WithPercentColumn
- Extension method StackedBar.WithShowLegend
- Method StackedBar.Add
- Method StackedBarFluent.WithCountColumn
- Method StackedBarFluent.WithLabelColumn
- Method StackedBarFluent.WithMaxLegendColumns
- Method StackedBarFluent.WithPercentColumn
- Method StackedBarFluent.WithShowLegend
Accepted by parameters 10
- Extension method StackedBar.WithCountColumn
- Extension method StackedBar.WithLabelColumn
- Extension method StackedBar.WithMaxLegendColumns
- Extension method StackedBar.WithPercentColumn
- Extension method StackedBar.WithShowLegend
- Method StackedBarFluent.WithCountColumn
- Method StackedBarFluent.WithLabelColumn
- Method StackedBarFluent.WithMaxLegendColumns
- Method StackedBarFluent.WithPercentColumn
- Method StackedBarFluent.WithShowLegend
Constructors
public StackedBar(String name = "stacked") #Creates a stacked bar.
Parameters
- name System.String = "stacked"
- The live name (default stacked).
Methods
public StackedBar Add(RichText label, Double value, ThemeToken? token = null) #StackedBarAdds or updates a segment with a multicolour legend label (its plain text is the key).
Parameters
- label ConsoleMonster.Text.RichText
- The rich label.
- value System.Double
- The value.
- token ConsoleMonster.Styling.ThemeToken? = null
- The colour token, or null for the next series colour.
Returns
This instance.
public StackedBar Add(String label, Double value, ThemeToken? token = null) #StackedBarAdds or updates a segment.
Parameters
- label System.String
- The label.
- value System.Double
- The value.
- token ConsoleMonster.Styling.ThemeToken? = null
- The colour token, or null for the next series colour.
Returns
This instance.
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public override Void Render(Region region, RenderContext context) #VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual String? Describe(LiveEvent liveEvent) #String?Parameters
- liveEvent LiveEvent
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Boolean ShowLegend { get; set; } #Whether the legend line is shown (default true).
public Int32 MaxLegendColumns { get; set; } #The most legend columns per row, or 0 (default) to fit as many as the width allows. Entries fill rows left to right and every row shares one grid, so labels, counts and percentages line up.
public ColumnFormat LabelColumn { get; set; } #Layout of the legend label column (default left-aligned).
public ColumnFormat CountColumn { get; set; } #Layout of the legend count column (default right-aligned; reserves the digits of the overall total).
public ColumnFormat PercentColumn { get; set; } #Layout of the legend percentage column (default right-aligned, four cells).
Inherited Properties
Extension Methods
public static StackedBar WithCountColumn(StackedBar stackedBar, ColumnFormat value) #StackedBarSets StackedBar.CountColumn: Layout of the legend count column (default right-aligned; reserves the digits of the overall total).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- value ConsoleMonster.Layout.ColumnFormat
- The value.
Returns
The same instance.
public static StackedBar WithCountColumn(StackedBar stackedBar, Action<ColumnFormat> configure) #StackedBarConfigures StackedBar.CountColumn in place: Layout of the legend count column (default right-aligned; reserves the digits of the overall total).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- configure System.Action<ConsoleMonster.Layout.ColumnFormat>
- Configures the value.
Returns
The same instance.
public static StackedBar WithLabelColumn(StackedBar stackedBar, ColumnFormat value) #StackedBarSets StackedBar.LabelColumn: Layout of the legend label column (default left-aligned).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- value ConsoleMonster.Layout.ColumnFormat
- The value.
Returns
The same instance.
public static StackedBar WithLabelColumn(StackedBar stackedBar, Action<ColumnFormat> configure) #StackedBarConfigures StackedBar.LabelColumn in place: Layout of the legend label column (default left-aligned).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- configure System.Action<ConsoleMonster.Layout.ColumnFormat>
- Configures the value.
Returns
The same instance.
public static StackedBar WithMaxLegendColumns(StackedBar stackedBar, Int32 value) #StackedBarSets StackedBar.MaxLegendColumns: The most legend columns per row, or 0 (default) to fit as many as the width allows. Entries fill rows left to right and every row shares one grid, so labels, counts and percentages line up.
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static StackedBar WithPercentColumn(StackedBar stackedBar, ColumnFormat value) #StackedBarSets StackedBar.PercentColumn: Layout of the legend percentage column (default right-aligned, four cells).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- value ConsoleMonster.Layout.ColumnFormat
- The value.
Returns
The same instance.
public static StackedBar WithPercentColumn(StackedBar stackedBar, Action<ColumnFormat> configure) #StackedBarConfigures StackedBar.PercentColumn in place: Layout of the legend percentage column (default right-aligned, four cells).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- configure System.Action<ConsoleMonster.Layout.ColumnFormat>
- Configures the value.
Returns
The same instance.
public static StackedBar WithShowLegend(StackedBar stackedBar, Boolean value = true) #StackedBarSets StackedBar.ShowLegend: Whether the legend line is shown (default true).
Parameters
- stackedBar ConsoleMonster.Widgets.StackedBar
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.