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
<CfBulletChart ... /> <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.
无质量带
3 段质量带
超过目标
Demo source
<CfBulletChart :value="92" :target="80" :max="100" :bands="bands" /> <CfBulletChart value={92} target={80} max={100} bands={bands} /> API
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Current value |
target | number | — | Target value (vertical line) |
max | number | — | Maximum value |
bands | { upTo: number; tone? }[] | [] | Qualitative bands (poor/ok/good) |
label | string | — |
反馈与讨论
BulletChart · Discussion