Skip to content
CHARTS · COMPLETE

Sparkline

A tiny trend line that fits inside a sentence or a table cell.

A tiny trend line without axes that fits inside a sentence or a table cell.

Why it helps

  • Small and quick
  • No axes
  • Fits in tables

Where it fits

  • Statistics
  • Table cells
  • Dashboards

Example

<Stack Direction="StackDirection.Column" Spacing="3">
    <Stack Align="center">
        <span style="width:6rem">Sales</span>
        <Sparkline Label="Sales trend" Values="_sales" Area />
        <strong>@_sales.Last().ToString("N0")</strong>
    </Stack>
    <Stack Align="center">
        <span style="width:6rem">Errors</span>
        <Sparkline Label="Error trend" Values="_errors" ColorIndex="4" />
        <strong>@_errors.Last()</strong>
    </Stack>
</Stack>

@code {
    private readonly double[] _sales = [120, 135, 128, 160, 190, 175, 210, 230];
    private readonly double[] _errors = [14, 11, 16, 9, 7, 8, 5, 4];
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Part of RayCraft Complete.

All controls ยท Documentation