StepChart
DisplayRenders a terminal step chart using Unicode box-drawing characters. Perfect for displaying discrete value changes over time or categories.
@using RazorConsole.Components
@using Spectre.Console
<StepChart Width="32" Title="Three charts" Height="11" ShowAxes="true"
Series="@GenerateChartSeries()"/>
@code{
private List<StepChart.ChartSeries> GenerateChartSeries()
{
return
[
new(Color.FromHex("0DBC79"), [new(1, 4), new(2, 5), new(3, 5), new(4, 4), new(5, 5), new(6, 6), new(7, 7), new(8, 8)]),
new(Color.FromHex("3B8EEA"), [new(1, 2), new(2, 2), new(3, 2), new(4, 3), new(5, 3), new(6, 4), new(7, 5), new(8, 6)]),
new(Color.FromHex("fc034e"), [new(1, 0), new(2, 0), new(3, 0), new(4, 1), new(5, 2), new(6, 2), new(7, 2), new(8, 3)])
];
}
}Parameters
8| Name | Type | Default | Description |
|---|---|---|---|
Appearance | |||
AxesColor | Color | — | Color of the axes lines and tick marks. |
Height | Int32 | — | Height of the chart in terminal rows (excluding title and axes if shown). |
LabelsColor | Color | — | Color of the numeric labels on X and Y axes. |
TitleColor | Color | — | Color of the chart title text. |
Width | Int32 | — | Width of the chart in terminal columns (excluding title and axes if shown). |
Common | |||
Title | String | — | Optional chart title displayed above the plot area. |
Other | |||
Series | List<ChartSeries> | — | Collection of data series to display on the chart. |
ShowAxes | Boolean | — | Determines whether coordinate axes and value labels are rendered. |