StepChart

Display

Renders 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
NameTypeDefaultDescription
Appearance
AxesColorColorColor of the axes lines and tick marks.
HeightInt32Height of the chart in terminal rows (excluding title and axes if shown).
LabelsColorColorColor of the numeric labels on X and Y axes.
TitleColorColorColor of the chart title text.
WidthInt32Width of the chart in terminal columns (excluding title and axes if shown).
Common
TitleStringOptional chart title displayed above the plot area.
Other
SeriesList<ChartSeries>Collection of data series to display on the chart.
ShowAxesBooleanDetermines whether coordinate axes and value labels are rendered.

API