BarChart
ClassFor examples and usage details, see the component documentation.
View BarChart ComponentNamespace:
RazorConsole.ComponentsAssembly:
RazorConsole.CoreDefinition
public class BarChart : ComponentBase, IComponent, IHandleEvent, IHandleAfterRenderConstructors
1| Name | Type | Description |
|---|---|---|
BarChart() | Constructor | — |
Properties
10| Name | Type | Description |
|---|---|---|
Appearance | ||
LabelBackground | Color | Background color of the chart label. Default is Plain background (transparent). |
LabelForeground | Color | Foreground (text) color of the chart label. Default is Plain foreground. |
Width | Nullable<Int32> | Width of the bar chart in characters. If null , uses available console width. |
Common | ||
Label | String | Label (title) displayed above the bar chart. |
MaxValue | Nullable<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%). |
ShowValues | Boolean | Whether numeric values should be displayed next to each bar. Default is false . |
Other | ||
BarChartItems | List<IBarChartItem> | Renders a bar chart using Spectre.Console's BarChart renderable. |
Culture | CultureInfo | CultureInfo to use when rendering values. Default is CurrentCulture. |
LabelAlignment | Nullable<Justify> | Alignment of the chart label. Options: Left, Center, Right. |
LabelDecoration | Decoration | Text decoration for the chart label (bold, italic, underline, etc.). Default is None. |
Methods
1| Name | Type | Description |
|---|---|---|
BuildRenderTree(RenderTreeBuilder)() | Method | — |