Home/ Cookbook/ Charts/ Waterfall

Waterfall (cash flow)

A start bar, a sequence of green and red change bars, an end bar. The chart accountants reach for first because it answers "how did we get from there to here?" in a single picture.

Charts · 19 of 20 1 primitive · Chart.Waterfall ~12 min React · @corelithzw/react

Overview

Anchor bars at the start and end; floating change bars in between, each starting where the previous left off. Positive deltas are green, negative are red.

Waterfalls explain a delta. "We started the quarter at $120k cash, ended at $95k — here's where the $25k went." Each intermediate bar floats above the x-axis at the running total, so the staircase visualises the running balance. They're indispensable for finance pages (P&L bridge, cash flow), and useful anywhere you need to decompose a change — onboarding funnel offsets, headcount churn, energy consumption decomposition.

Reach for it when the data is a sequence of additive contributions to a total. Skip it if the contributions aren't additive (use a stacked bar) or if the start and end are the only numbers that matter (use a delta + two anchors).

The opinion: always show the start and end values as full bars, anchored at zero. Floating-only waterfalls hide the magnitude and trick the eye into reading deltas as absolutes.

The chart

Q3 cash bridge: opening balance, plus revenue and tax refund, minus payroll, rent, supplies, closing balance.

Q3 cash bridge Opening cash 120k. Revenue +80k, tax refund +10k, payroll -60k, rent -28k, supplies -27k, closing cash 95k. 0 50 100 150 200 $120k Opening +$80k Revenue +$10k Tax refund −$60k Payroll −$28k Rent −$27k Supplies $95k Closing

Required pieces

Roadmap: Chart.Waterfall with auto running-total layout, totals at start/end and connectors ships in v0.2. v0.1-alpha users compute the y-offsets and emit rects.

React snippet

Steps as objects with a type ('start' | 'change' | 'total') and a value.

Chart.Waterfall@corelithzw/react

Customising

With sub-totals

Insert type: 'subtotal' at boundary points — after revenue, after costs — so the bridge tells a P&L story.

{ type: 'subtotal',
  label: 'Gross',
  value: 210000 },
{ type: 'change',
  label: 'Opex',
  value: -115000 },

Horizontal orientation

Lay the waterfall left-to-right for landing screens — bigger numbers, easier to read on phones.

<Chart.Waterfall
  orientation="horizontal"
  steps={cashBridge}
  width={640}
  height={240}
/>

Percent-of-start scale

Normalise everything to opening — useful when comparing two periods on the same axis.

<Chart.Waterfall
  steps={cashBridge}
  scale="pct-of-start"
  format={(v) => `${v.toFixed(1)}%`}
/>

In context

A finance dashboard hero — title, the two anchor numbers as stat hero, the waterfall under them so the bridge fills the rest of the card.

Q3 cash bridge
$120k → $95k
−$25k · payroll the biggest line
120 +80 +10 −60 −28 −27 95 OpenRev.TaxPayRentSupp.Close

Accessibility

The whole point of a waterfall is the sequence. Make sure the order, signs, and running total are all reachable as text.

  • One role="img" per chart. <title> names it, <desc> lists every step with sign and value in order.
  • Aria-label states the bridge. "Q3 cash bridge from $120k to $95k, payroll the largest line at minus $60k" — start, end, headline driver.
  • Signs are not colour-only. Values are labelled with "+" and "−" prefixes; the fallback table has a "sign" column.
  • Each bar is a tab target. Aria-label: "Payroll, minus $60k, running total $150k". Arrow keys move through the sequence.
  • Connectors are decorative. The dashed running-total lines have aria-hidden="true" — they convey nothing extra over the bars.
  • Numeric fallback table. Hidden <table> with step / type / value / running-total columns.