MoneyChart
Line/area with a money axis and negative-aware baseline.
npx shadcn add @lopifi/money-chartExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Forecast with a band
The tail is dashed, its interval named, and the scenarios fan out from the split.
Against plan
The plan carries its own polarity: opex under plan is favorable, revenue under plan is not.
How it behaves
What it renders, what it refuses to render, and why. The same paragraphs as the family spec, so the two can’t disagree.
Line and area, with everything a generic chart library gets wrong about money:
- Money-formatted axis, abbreviated (
$1.2M) with the exact value in the tooltip. Abbreviation is allowed here; see numerics. - Zero baseline is emphasized: a 1px
--border-strongline, distinct from the--border-subtlegridlines. When data crosses zero, it's the most important line in the chart. - Negative regions stand out: a fill below zero at
--negativewith a 45° hatch, so it survives grayscale. - Y-axis starts at zero for quantities. The only sanctioned exception is a rate chart (
CurrencyPairChart), and there the axis is explicitly labeled. - Projections are dashed. A forecast drawn like actuals is a lie. The boundary is drawn too, as a dashed vertical rule labeled
Forecast →, because you can't read a date off a dash pattern spread over six months. - Gridlines: horizontal only,
--border-subtle. Vertical gridlines on a time series are noise. - Area fill is the one sanctioned gradient: a single hue fading to transparent, which keeps the line readable over gridlines. It's there for legibility, not decoration.
- Multi-currency series is rejected at the type level. Convert to a stated presentation currency first, and label the axis with it.
The FP&A layer#
A plan chart has to say four things a line chart can't. Leaving any of them out is a way of being wrong that a prettier chart hides.
- The range, and what it is.
bandtakes a low, a high and a requiredlabel(P10–P90,±1σ,Downside to upside). A shaded cone with no stated interval claims a precision nobody gave it, and a reader who can't tell which interval it is will assume whichever suits them. The band gets a hairline edge as well as a fill, because a fill alone disappears on a projector and the edges are what people quote. It widens with distance, or it's lying about what can be known. - The alternatives, unranked.
scenariosdraws base, upside and downside from the same anchor, told apart by dash rhythm first and color second. In red-amber-green, a third of readers can't separate the three lines. No best-case styling and no ordering by outcome. A scenario is a set of assumptions, and calling one the good one turns a forecast review into a negotiation over which line goes to the board. - The plan.
planis a reference, not a series: dotted, in the neutral tertiary tone, with no viz color and no place in the legend's isolate control. A budget is the line the business agreed to, not something that happened. A series color would put it in competition with the measure it's meant to be read against. - The variance, in words that survive grayscale. Stated as F and U, not a color or a bare sign. Favorable and unfavorable are the terms of art and stay unambiguous under polarity: a cost under plan is F and revenue under plan is U, yet both are negative absolute variances. Red and green can't carry that.
plan.polarityis required for the same reason as everywhere else. A chart doesn't know its own polarity, and guessing gets half of FP&A backwards.
The variance is always taken against the first series declared, and the readout disappears when that series is isolated away. A variance whose base silently changes as the reader filters is worse than none, because the number moves and nothing on the chart says why.
The band, the scenarios and the plan all sit inside the y-domain. A cone clipped by the axis quietly crops the bad case out of the picture.
The table equivalent carries all of it: a Basis column marking each period actual or forecast, the band's range, each scenario, the plan and the variance. A table of base values alone isn't the chart in another form. It's a different, more confident chart.
Motion: stroke-dashoffset draw, 400ms --ease-out, once on mount or scroll-into-view. Instant on data change.
Touch: 44px-tall scrub target across the plot, with a persistent readout in a fixed header, not a floating tooltip under the finger.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Dashboard & charts
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section MoneyChart renders in, the calculators behind its figures, and the ledger payloads that feed it.
- MoneyChart, runningThe charts showcase — live, with theme, density, grayscale and reduced-motion switches.
- NPV, IRR & XIRRNPV, payback and every IRR a series has, not just the first a solver finds.
- Dashboard & chartsWe wrap a charting engine (Recharts, or visx where we need more control) instead of building one. What we add is everything a chart library doesn't know about money. Specs for 11 React components: DashboardShell, KpiRow, MoneyChart, MoneyBarChart and 7 more.
Components are copied into your repository and meant to be edited. Rounding policy, fiscal calendar and compliance copy differ per company.
Release notes
Get an email when Dashboard & charts changes
Your copy doesn’t update itself when we fix something here.
- One email when a Dashboard & charts component needs a migration
- Nothing when nothing changes
Or install it now