Bullet charts

A bullet chart shows a value against its target in a single row: a bar for the value, a mark for the target, and tinted ranges for poor, fair and good. Several fit where one gauge would, so they suit dashboards and KPI lists.

Measures with their own scales

Each BulletSeries is a row with its own scale from Min (default 0) to Max, with tick labels under it, so measures in different units can share a chart. Give it a Value, a Target and ColorBands: the bands are tinted behind the bar, and the bar takes the color of the band its value is in. Rows are labeled by their Name; there is no legend.

March. Bullet chart with 3 items: Revenue 268 k€ (0 k€–300 k€, Target 250 k€), Margin 22% (0%–40%, Target 26%), Rating 4.4 (1.0–5.0, Target 4.2). MarchRevenueMarginRating0 k€50 k€100 k€150 k€200 k€250 k€300 k€0%5%10%15%20%25%30%35%40%1.01.52.02.53.03.54.04.55.0Use Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="object" Title="March">
    <BulletSeries Name="Revenue" Value="268" Max="300" Target="250" Format="0 k€" ColorBands="revenue" />
    <BulletSeries Name="Margin" Value="22" Max="40" Target="26" Format="0'%'" />
    <BulletSeries Name="Rating" Value="4.4" Min="1" Max="5" Target="4.2" Format="0.0" />
</RioChart>

@code {
    ColorBand[] revenue =
    [
        new() { Below = 150, Color = "--rio-negative" },
        new() { Above = 225, Color = "--rio-positive" },
    ];
}

A row per item

With Items, XValue labels each row and YValue is its value; TargetValue gives each item its own target. The rows share the series' scale. With Aggregate, items with the same x make one row, and their targets are combined the same way. DataLabels writes the value after the bar.

Sales against target. Bullet chart with 4 items: North 182 k€ (0 k€–200 k€, Target 160 k€), South 96 k€ (0 k€–200 k€, Target 130 k€), East 141 k€ (0 k€–200 k€, Target 140 k€), West 120 k€ (0 k€–200 k€, Target 100 k€). Sales against targetNorthSouthEastWest0 k€50 k€100 k€150 k€200 k€182 k€96 k€141 k€120 k€Use Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart TItem="Region" Items="regions" Title="Sales against target">
    <BulletSeries XValue="r => r.Name" YValue="r => r.Sales" TargetValue="r => r.Target" Format="0 k€" DataLabels="true" />
</RioChart>

@code {
    record Region(string Name, double Sales, double Target);
}

In JSON definitions

"type": "bullet" with x (the rows), y, and a "targetField" with each row's target, or one "target" for all; "min", "max" and "colorBands" as for gauges. Without x a bullet shows one value from the rows (the last, or the aggregate).

{ "dataset": "sales", "series": [ { "type": "bullet", "x": "region", "y": "amount", "targetField": "goal", "aggregate": "sum" } ] }
An unhandled error has occurred. Reload 🗙