---
title: "MoneyChart"
description: "Line/area with a money axis and negative-aware baseline."
canonical: "https://lopifi.com/components/money-chart"
---

# MoneyChart

> Line/area with a money axis and negative-aware baseline.

Source: https://lopifi.com/components/money-chart
Part of: Lopifi — Your VC tech stack partner (https://lopifi.com)

---

- **Family:** Dashboard & charts — 
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/dashboard-charts

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/money-chart
```

## Specification

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](https://lopifi.com/md/docs/foundations/numerics#abbreviation).
- **Zero baseline is emphasized**: a 1px `--border-strong` line, distinct from the `--border-subtle` gridlines. When data crosses zero, it's the most important line in the chart.
- **Negative regions stand out**: a fill below zero at `--negative` with 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.** `band` takes a low, a high and a **required** `label` (`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.** `scenarios` draws 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.** `plan` is 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.polarity` is 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.

## Rules this component obeys

Money is minor units, never floats. `null` is not `0` and neither is redacted. Negatives render in accounting parentheses with the parenthesis column reserved on both sides. Debit and credit are two columns. Per-currency decimal places. Polarity is explicit — up is not always good. Every figure states its period, entity, currency, basis and as-of.
