BarChart

Class

For examples and usage details, see the component documentation.

View BarChart Component
Namespace: RazorConsole.Components
Assembly: RazorConsole.Core

Definition

public class BarChart : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Constructors

1
NameTypeDescription
BarChart()Constructor

Properties

10
NameTypeDescription
Appearance
LabelBackgroundColorBackground color of the chart label. Default is Plain background (transparent).
LabelForegroundColorForeground (text) color of the chart label. Default is Plain foreground.
WidthNullable<Int32>Width of the bar chart in characters. If null , uses available console width.
Common
LabelStringLabel (title) displayed above the bar chart.
MaxValueNullable<Double>Fixed maximum value for scaling bars. When set, bars scale relative to this value instead of the largest data point. Example: MaxValue = 100 creates a progress chart (0–100%).
ShowValuesBooleanWhether numeric values should be displayed next to each bar. Default is false .
Other
BarChartItemsList<IBarChartItem>Renders a bar chart using Spectre.Console's BarChart renderable.
CultureCultureInfoCultureInfo to use when rendering values. Default is CurrentCulture.
LabelAlignmentNullable<Justify>Alignment of the chart label. Options: Left, Center, Right.
LabelDecorationDecorationText decoration for the chart label (bold, italic, underline, etc.). Default is None.

Methods

1
NameTypeDescription
BuildRenderTree(RenderTreeBuilder)()Method