Bar chart
Vertical bars from data array. Supports per-bar coloring, rounded corners, and highlight.
Primitive:
ChartBarInteractive demo
Usage
import { ChartRoot, ChartBar, ChartAxisY } from '@ramtt/charts'
<ChartRoot data={[40, 65, 30, 80, 55]} height={200}>
<ChartBar className="fill-[var(--n1150)]" radius={3} gap={2} />
<ChartAxisY />
</ChartRoot>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| gap | number | 1 | Gap between bars in pixels |
| radius | number | 0 | Corner radius |
| colorFn | (value, index) => string | — | Per-bar color function |
| highlightIndex | number | null | — | Highlighted bar index |
| className | string | — | Default bar fill class |