Skip to content

Block 262 of 297

Bullet Chart

Compact gauges showing each measure's actual value against a target and poor, fair and good bands.

Puck key
BulletChartBlock
Export
bulletChartBlock
React component
<BulletChart />
Path
components/puck/bullet-chart-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A compact scorecard: each measure gets a thin bar for the actual value, a black target tick and gray background bands for poor, fair and good ranges. A rating and the distance to target are written under each bar. In a wide card the label sits to the left of its bar; in a narrow card it stacks above. Values accept {{ source.field }} bindings.

  • A quarterly board scorecard against approved targets
  • Program KPIs with agreed performance thresholds
  • Grant outcome measures compared with commitments
Writing the content
  • Set Poor below and Fair below for each measure; anything above Fair below counts as good.
  • Bands assume higher is better. For measures where lower is better, such as cost per client, use a different widget.
  • Leave Scale maximum blank to fit the data, or set it so related measures share a scale.
  • Measures accept one to eight entries. Prefix and Suffix are set per measure, so % and hrs can sit in the same card.
Accessibility
  • Each bar has role="img" with a label giving the actual value, the target, the rating range and the band thresholds.
  • The rating (Poor, Fair, Good) and "Target met" or "x to target" are printed as text, so they don't depend on gray shades (WCAG 1.4.1).
  • A text key explains the bar, tick and bands, and "View data table" lists every threshold and rating in a real table.
Customizing the code
  • Band shades are bg-neutral-300 and bg-neutral-200 on a neutral-100 track; the actual bar is bg-indigo-600.
  • In wide cards the label column width is @md:w-40.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Titletext
  • Heading levelselect
  • Subtitle or periodtext
  • Measuresarray
  • Footnotetext