Preview Updated 2026-05-10

BulletChart

Single-value progress bar with a target marker and qualitative bands — better suited than Gauge for "compare against target" semantics.

Basic usage

Data is passed in via props and rendered as plain SVG — no third-party charting library. Colors come from the --viz-1..8 tokens and are color-blind friendly.

Demo source
src/App.vue vue
<CfBulletChart ... />
src/App.tsx tsx
<CfBulletChart ... />

Bands + exceeding target

bands provides three colored segments and target draws a vertical line; when the value exceeds the target the bar extends past it.

Demo source
src/App.vue vue
<CfBulletChart :value="92" :target="80" :max="100" :bands="bands" />
src/App.tsx tsx
<CfBulletChart value={92} target={80} max={100} bands={bands} />

API

PropTypeDefaultDescription
valuenumberCurrent value
targetnumberTarget value (vertical line)
maxnumberMaximum value
bands{ upTo: number; tone? }[][]Qualitative bands (poor/ok/good)
labelstring

反馈与讨论

BulletChart · Discussion

0
0 / 600
一键发送
正在加载评论...