Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bullet chart

Stephen Few's compact performance-vs-target chart. A horizontal (or vertical) bar with three qualitative ranges painted behind it, a target marker line, and the current value as a thinner foreground bar.

The demo reports the 2005 DARPA Grand Challenge — Stanford's "Stanley" drove 132.2 mi across the Mojave (target: 132 mi) in 6 h 53 m to take the $2 M prize. The 2004 Challenge's best result was 7.4 mi; one year later five robots finished. The visible band just inside the target marker is the moment self- driving cars stepped off the slide deck.

Source: DARPA Grand Challenge (2005) — Wikipedia

Public surface

use wisp_chart::indicator::{Bullet, Orientation};

let bullet = Bullet {
    value: 270.0,
    target: 250.0,
    ranges: [150.0, 225.0, 300.0], // poor → ok → good thresholds
    orientation: Orientation::Horizontal,
};

let g = bullet.emit_graphics(&theme, Vec2::new(400.0, 80.0));
let _ = stage.add_child(root, g);

The five primitives

Info

A bullet chart renders five primitives in this order:

  1. Poor band — [0, ranges[0]], light grey
  2. OK band — [0, ranges[1]], medium grey (paints over poor)
  3. Good band — [0, ranges[2]], darker grey (paints over OK)
  4. Value bar — thinner foreground bar from 0 to value
  5. Target line — vertical (or horizontal) marker at target

Bands paint over each other because each spans from 0 to its threshold. The visible bands are the differences: poor is the portion before ranges[0], OK is the strip from ranges[0] to ranges[1], good is the strip from ranges[1] to ranges[2].

Orientation

OrientationUse case
Horizontal (default)Dashboard rows, tight vertical packing
VerticalSidebar KPIs, when label fits to the left

Theme integration

FieldDrives
theme.indicator.bullet_poor_colorPoor (lowest) qualitative band
theme.indicator.bullet_ok_colorSatisfactory (middle) band
theme.indicator.bullet_good_colorGood (highest) band
theme.indicator.bullet_value_colorValue bar fill
theme.indicator.bullet_target_colorTarget marker line

Why bullet vs gauge

Tip

For one-shot dashboard tiles where vertical space is tight, bullet wins — it fits inside a row that already has a label and delta, while a gauge needs its own square aspect. Save gauges for the one hero metric that justifies the footprint.