Bullet
How it’s built
A bullet chart puts several blocks in the same place, so they read as one bar. The slat contains:
- a
Barto 120, which is the track, - a
Bartod.done, the progress along that track, - a
Tickat 100, the goal, - a
Labelwithedge="end"for the percentage.
Blocks paint in the order you write them, so the progress covers the track and the goal sits on top of both.
The scale is [0, 120], which leaves room to overshoot the goal.
The gallery version adds:
- An icon instead of a name.
The start
Labelholds an SVG path rather than text, colored with the slat’s own--rhp-color, so the icon matches its bar. - A bubble at the tip of the progress.
It is a
Labelwithat={d.done}, so it follows the end of the bar, and the slat’s CSS fades it in on hover.
The simple version
A track, the progress along it, and a target line. The same structure with almost no styling: a good place to start your own.
The gallery version
12 of 23Today's goals
Progress toward each day's goal on a track to 120%, glowing like a watch face.
- Tick target
- SVG in a Label
- hover