Bullet chart
Since 0.1.0-alpha.23Use bullet graphs to show measures against their targets, such as a KPI scorecard. Stephen Few designed them to replace dashboard gauges. A bar's length reads more exactly than a dial's angle, and many fit in the space of one gauge. Without ranges, a bar chart with Target on its bars does the same job.
A KPI scorecard
Give BulletChart the Items, each row's Label, Value and Target. Max gives each row a scale of its own, so measures of different sizes sit together, and Format gives each its unit.
Static
Preview
- Revenue
- Profit margin
- Average order
- New customers
- Satisfaction (1–5)
| Measure | Actual | Plan | Range |
|---|---|---|---|
| Revenue | $275K | $250K | Good |
| Profit margin | 23% | 27% | Satisfactory |
| Average order | $320 | $550 | Poor |
| New customers | 1,650 | 2,100 | Satisfactory |
| Satisfaction (1–5) | 4.6 | 4.4 | Good |
Code
@* A company's year to date against plan: each measure on its own scale, in its own unit, with the
ranges finance set for poor, satisfactory and good. *@
<BulletChart Items="_kpis" Title="2026 year to date against plan"
Label="k => k.Measure" Value="k => k.Actual" Target="k => k.Plan" Max="k => k.Max"
Ranges="k => k.Ranges" RangeLabels="(["Poor", "Satisfactory", "Good"])" Format="k => k.Format" />
{
private record Kpi(string Measure, double Actual, double Plan, double Max, double[] Ranges, string Format);
private readonly Kpi[] _kpis =
[
new("Revenue", 275_000, 250_000, 300_000, [150_000, 225_000], "$#,##0,K;;$0"),
new("Profit margin", 0.225, 0.27, 0.30, [0.20, 0.25], "0%"),
new("Average order", 320, 550, 600, [350, 500], "$#,##0"),
new("New customers", 1_650, 2_100, 2_500, [1_400, 2_000], "#,##0"),
new("Satisfaction (1–5)", 4.6, 4.4, 5, [3.5, 4.25], "0.0"),
];
}Add this example to a page with the izzy CLI:
izzy add component BulletChart --at <file>:<line>Ranges gives each row the ends of its ranges but the last, which runs to the row's max; RangeLabels names them, in the tooltip, the table and to screen readers. Ranges are grays, darkest first: the bar stays the strongest mark.
Each row is a meter, read as "275K, target 250K, Good". With the script, the rows are one Tab stop and the arrow keys move between them.
Shared bands
For the same ranges on every row, write GaugeBands inside the chart. Without Max, the rows share one scale, from Min to past the largest value, and one axis under them.
Static
Preview
- Home
- Search
- Product
- Cart
- Checkout
| Template | Seconds | Target | Range |
|---|---|---|---|
| Home | 1.8 s | 2.0 s | Good |
| Search | 2.2 s | 2.0 s | Good |
| Product | 2.9 s | 2.0 s | Needs improvement |
| Cart | 2.4 s | 2.0 s | Good |
| Checkout | 4.6 s | 2.0 s | Poor |
Code
@* Largest Contentful Paint at the 75th percentile, by page template, against Google's thresholds:
the same three bands on every row, so the rows share one scale. *@
<BulletChart Items="_pages" Title="Largest Contentful Paint (p75), last 28 days"
Label="p => p.Template" Value="p => p.Seconds" Target="p => 2.0" ValueFormat="0.0 s"
Palette="ChartPalette.Of(Color.Success, Color.Warning, Color.Danger)">
<GaugeBand From="0" To="2.5" Label="Good" />
<GaugeBand From="2.5" To="4" Label="Needs improvement" />
<GaugeBand From="4" To="6" Label="Poor" />
</BulletChart>
{
private record Page(string Template, double Seconds);
private readonly Page[] _pages = [new("Home", 1.8), new("Search", 2.2), new("Product", 2.9), new("Cart", 2.4), new("Checkout", 4.6)];
}Palette colors the ranges in order, here green, amber and red; a band's own Accent takes the place of its color.
Red and green are the colors color-blind readers most often confuse, so give every band a Label: the tooltip, the table and screen readers name the range a value is in, and the color isn't the only cue.
A scale that doesn't start at zero (Min) draws each value as a dot, since a bar's length would no longer be the value.
Vertical
To stand the rows up as columns, labels above, set Orientation="Orientation.Vertical". The left and right arrow keys move between columns.
Static
Preview
- North
- South
- East
- West
- Central
| Region | Bookings | Quota | Range |
|---|---|---|---|
| North | $4.2M | $4.0M | On track |
| South | $2.6M | $3.5M | Near |
| East | $3.9M | $3.8M | On track |
| West | $3.1M | $4.5M | Near |
| Central | $1.7M | $2.4M | Near |
Code
@* Each region's quarter so far against its quota, standing up. The ranges are each region's own:
under 60% of quota is behind, 60–90% near, past 90% on track. *@
<BulletChart Items="_regions" Title="Q4 bookings against quota" Orientation="Orientation.Vertical"
Label="r => r.Region" Value="r => r.Bookings" Target="r => r.Quota" ValueFormat="$#,##0.0M"
Ranges="r => new[] { r.Quota * 0.6, r.Quota * 0.9 }" RangeLabels="(["Behind", "Near", "On track"])" />
{
private record Sales(string Region, double Bookings, double Quota);
private readonly Sales[] _regions = [new("North", 4.2, 4.0), new("South", 2.6, 3.5), new("East", 3.9, 3.8), new("West", 3.1, 4.5), new("Central", 1.7, 2.4)];
}Details
With Max, each row has a scale of its own (revenue and margin side by side, each readable), with its ticks under it; without, the rows share one scale and one axis. Ranges gives each row its ranges (the ends of all but the last, which runs to its max); GaugeBand children give every row the same. Ranges are grays, darkest first, until Palette or a band's Accent colors them. A scale that doesn't start at zero (Min) draws the value as a dot, since a bar's length would mislead. Orientation Vertical stands the rows up as columns, labels above.
Parts
Written inside BulletChart. The API page lists their parameters.
GaugeBand: a range on aGauge's dial or aLinearGauge's scale, such as where a load turns high:<GaugeBand From="0.7" To="0.9" Accent="Accent.From(Color.Warning)" Label="High" />.
Mode support
| Feature | Static | Interactive |
|---|---|---|
| A bar against a target tick, over ranges in grays (Stephen Few's bullet graph) | Yes | Yes |
| A scale per row, for measures in different units, or one shared scale and axis | Yes | Yes |
| Ranges per row, or bands every row shares, colored by a palette | Yes | Yes |
| Rows across, or standing up as columns | Yes | Yes |
| Each row read as a meter, with its value, target and range in words | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Accessibility
- The chart is a figure captioned by
Title, or named by a heading on the page withTitledBy. - The rows are a list; each row is a meter named by its label, with its value, target and range in words ("275, target 250, Good"). Colors aren't read:
RangeLabelsand the bands' labels say what each range means. - "Show data" under the chart opens the same numbers as a table (
DataTable). - With IzzyBlazor's script, the rows are one Tab stop: the arrow keys move from row to row, each showing its tooltip.
Keyboard navigation
On the rows
| Press this key | To do this |
|---|---|
| Down or Up (Right or Left in a vertical chart) | Move to the next or previous row |
| Home or End | Go to the first or last row |
| Escape | Hide the tooltip |
Parameters
| Prop | Type | Default |
|---|---|---|
RefreshHow often the chart reads its data again, at least a second, such as Refresh="TimeSpan.FromSeconds(30)". | TimeSpan? | |
RefreshFromOn a static page with Refresh: a lighter page to fetch than this one, which renders the same chart with the same id. | string? | |
ItemsThe items, a row each, in order. | IEnumerable<TItem>? | Required |
LabelEach row's name, such as k => k.Name: beside its row, and its meter's accessible name. | Expression<Func<TItem, object?>> | Required |
ValueEach row's value, such as k => k.Actual: the bar. | Expression<Func<TItem, object?>> | Required |
TargetEach row's goal, such as k => k.Goal: a tick across the row, read with the value. | Expression<Func<TItem, object?>>? | |
MaxEach row's own scale end, such as k => k.Max: the rows then each have their own scale and ticks, for measures in different units or sizes. | Expression<Func<TItem, object?>>? | |
MinWhere every row's scale starts. | double | 0 |
RangesEach row's ranges, such as k => k.Thresholds: the ends of all but the last, in order, numbers of any type ([150, 225] on a scale to 300 makes three ranges). | Func<TItem, IEnumerable?>? | |
RangeLabelsWhat Ranges' ranges mean, in order, such as ["Poor", "Fair", "Good"]: in the tooltip, the table and the meter's words, so color isn't the only cue. | IReadOnlyList<string>? | |
PaletteThe ranges' colors, in order, such as ChartPalette.Of(Color.Danger, Color.Warning,
Color.Success), drawn as tints so the bar stays the strongest mark. | ChartPalette? | computed |
AccentThe bar's color, such as Accent.Of("#0d9488"). | Accent? | computed |
ValueFormatA .NET format string for the values, targets and ticks, such as C0, N0 or P0. | string? | |
FormatEach row's own format string, such as k => k.Format, for rows in different units (revenue in C0 beside a margin in P0); a null falls back to ValueFormat. | Func<TItem, string?>? | |
OrientationRows across (horizontal, the default) or standing up as columns, their labels above. | Orientation | Orientation.Horizontal |
TitleThe chart's title, such as "Q3 against plan", shown above it as its caption. | string? | |
HideTitleHides the title, which still names the chart for screen readers. | bool | false |
TitleAlignWhere the title sits: at the start by default (the left, in a left-to-right page); ChartAlign.Center or ChartAlign.End. | ChartAlign | ChartAlign.Start |
TitledByThe id of a heading already on the page that titles the chart, such as a card's, in place of Title: the chart takes its name from it and shows no title of its own. | string? | |
DownloadShows a button across from the title that saves the chart as a PNG, named after its title, in the color scheme on screen. | bool | false |
TooltipA tooltip for the row under the pointer or keyboard focus. | bool | true |
DataTableThe values as a table: by default behind a "Show data" button that opens it over the chart; ChartDataTable.Collapsed puts it in a disclosure under the chart. | ChartDataTable | ChartDataTable.Popover |
ChildContentGaugeBands: ranges every row shares, on the shared scale. | RenderFragment? | |
OnRefreshOn an interactive page with Refresh: raised at each interval, to load new data. | EventCallback |
Plus 17 item props and 4 common props.
Full APISee also
- Gauge: shows one value against its range, such as progress toward a goal.
- Chart: draws a chart on the server from a list of items, with axes, value labels, reference lines, trends and a table of the values, for every chart type.