React charts
Opinionated React charts for narrative business dashboards.
Bars, lines, waterfalls and runways that say what changed, and whether it is on plan.
npm i tally-chartsOne chart, a few lines
Pass your rows and name the columns. The target, the labels and the loss color come from the same props.
import { BarChart } from 'tally-charts'
<BarChart
data={weeks}
x="week"
y="margin"
domain={[26, 36]}
format="percent"
valueLabel="all"
target={{ value: 32, label: 'Target 32%' }}
tone={(d) => (d.margin < 32 ? 'loss' : 'accent')}
title="Margin by week, last 6 weeks"
/>Margin by week, last 6 weeks 2 weeks under target
| Week | Margin |
|---|---|
| W1 | 34.2% |
| W2 | 35.1% |
| W3 | 33.0% |
| W4 | 33.6% |
| W5 | 30.2% |
| W6 | 29.4% |
A visual language that reads at a glance
Four rules, the same in every chart. Readers learn them once.
Hatched is plan
Stripes mark a plan, a forecast or a reference.
Solid is actual
Filled marks are what really happened.
Coral is loss
One loud color, saved for what went wrong.
Targets come first
The goal is drawn on the chart, not in a footnote.
Fifteen charts, one grammar
Pick the chart by the question it answers. Each page has live examples and a props table.
- BarChart Values over categories or time
- GroupedBarChart Several series side by side in each category
- StackedBarChart A total per category and what it is made of
- ComparisonBars Plan against actual, side by side
- RankedBars Sorted categories, biggest first
- WaterfallChart Steps from a start to an end value
- BridgeChart How one total became another
- DotHistogram One dot per item, binned
- StripPlot Distributions, row by row
- ScatterChart Two measures, and a third as size
- WaffleColumns Counts as unit squares
- LineChart Trends, forecasts and ranges
- StackedAreaChart A total over time and what it is made of
- Heatmap Two dimensions, one intensity
- RunwayChart What runs out before the reset
- Small pieces Sparkline, Meter, ShareBar and other building blocks
Nine reference dashboards
Live examples, rendered from the same code you can copy. Pick one to see it at full size.
Gross margin: weekly result, 12-week trend and what pulls it under target
Built for real dashboards
Accessible by default
Keyboard navigation, screen reader announcements, a hidden data table and forced-colors support.
Server Components
Charts render on the server and stay light on the client.
Themed with tokens
Every color, stripe and radius is a --ch-* CSS variable you can override.
Light and dark
Follows the system, or force a theme on any ancestor.
Draw your first chart
Install the package, pass your rows, name the columns.
npm i tally-charts