Histogram
Binned histogram with one bar per bin.
Basic usage
Data is passed in via props. Pure SVG rendering, no third-party chart library dependency.
Colors come from the --viz-1..8 tokens and are colorblind-friendly.
Demo source
<CfHistogram ... /> <CfHistogram ... /> Two typical distributions
Normal vs. long-tail distribution — for long-tailed data, consider log-scale bin labels.
正态分布
长尾分布
Demo source
<CfHistogram :bins="bins" /> <CfHistogram bins={bins} /> API
| Prop | Type | Default | Description |
|---|---|---|---|
bins | HistogramBin[] | — | { label, count }[] |
colorIndex | 0..7 | 0 | |
showLabels | boolean | true | Show/hide bin labels |
反馈与讨论
Histogram · Discussion