Components

Waterfall Chart

Trace signed contributions from an opening balance to a closing total.

Loading chart…

Quarterly cash contribution flow (USD thousands)
StepKindValue ($k)From ($k)Balance ($k)
Openingstart1200120
Salesdelta75120195
Refundsdelta-15195180
Subtotalsubtotal1800180
Costsdelta-65180115
Taxdelta-2011595
Closingend95095

Usage

Use computeWaterfallData to prepare rows for the bars and connectors.

Composition
<Chart.Root config={config}>
  <Chart.ResponsiveContainer width="100%" height={280}>
    <Chart.WaterfallChart data={data} layout="vertical" animate accessibilityLayer>
      <Chart.XAxis type="number" />
      <Chart.YAxis type="category" dataKey="id" />
      <Chart.WaterfallConnectors data={data} position="middle" />
      <Chart.WaterfallSeries>
        {data.map((row) => <Chart.Cell key={row.id} fill={row.kind !== "delta" ? "#733bff" : (row.value ?? 0) < 0 ? "#be123c" : "#15803d"} />)}
      </Chart.WaterfallSeries>
      <Chart.Tooltip filterNull={false} content={(tooltip) => {
        const row = data.find((row) => row.id === String(tooltip.label));
        return tooltip.active && row ? <div>{row.label}: {row.value ?? "Unknown"} ($k); balance {row.balance ?? "Unknown"} ($k)</div> : null;
      }} />
    </Chart.WaterfallChart>
  </Chart.ResponsiveContainer>
</Chart.Root>

Use one unstacked series. layout="vertical" produces horizontal bars. Label the category axis from id; the color key describes step roles rather than toggling contributions.

Inputs and checkpoints

computeWaterfallData(entries, initialBalance = 0) returns new ordered rows. These values are USD thousands.

KindSupplied valueBehavior
"start"number | nullDraw zero to value; establish an absolute opening balance.
"delta"number | nullDraw previous balance to previous balance plus the signed change.
"subtotal"NoneDraw zero to current balance without adding it again or resetting it.
"total"number | nullEstablish an explicit absolute checkpoint.
"end"number | nullEstablish an explicit closing checkpoint; never infer a final sum.

Opening $120k, sales and refunds produce a $180k subtotal; costs and tax leave $95k. Checkpoints supply explicit balances and may intentionally differ from the preceding result.

Connectors join adjacent known, matching balances. Place them before bars; subset chart and connector rows together. Missing geometry or disagreeing checkpoints break the connection.

Missing and zero values

A null change/checkpoint makes the balance unknown until a known checkpoint restores it. To start unknown, call computeWaterfallData(entries, null).

Loading chart…

Missing cash change and checkpoint recovery (USD thousands)
StepKindValue ($k)From ($k)Balance ($k)
Openingstart80080
Salesdelta4080120
PendingdeltaUnknown120Unknown
Feesdelta-10UnknownUnknown
Auditedtotal1050105
No changedelta0105105
Closingend1050105

Pending leaves Fees’ −$10k value known but its geometry unknown; Audited restores $105k. Zero changes retain zero-width geometry, with no fabricated minimum bar.

Values must be finite or null; subtotals must omit value. Invalid kinds/IDs, duplicate IDs, omitted change/checkpoint values, nonfinite values and arithmetic overflow throw.

Materials

Choose paper, plain, clay or glow. Custom shape or filter owns the finish; arithmetic and connectors stay unchanged.

Loading chart…

Cash flow with a selected bar material (USD thousands)
StepKindValue ($k)From ($k)Balance ($k)
Openingstart1200120
Salesdelta75120195
Refundsdelta-15195180
Subtotalsubtotal1800180
Costsdelta-65180115
Taxdelta-2011595
Closingend95095

Motion and inspection

WaterfallChart aliases BarChart. Entrance reveals ranges from numeric zero, not sequential arithmetic. Interaction finishes it; reduced motion skips it. Native per-series animation stays disabled.

Use value, start and balance in tooltip content; native range payloads contain endpoints. filterNull={false} permits unknown-step inspection. Range bars cannot use scalar category emphasis.

API reference

Focused props for ordered data and explicit Recharts composition; native axes, Cells and reference lines retain their geometry.

computeWaterfallData

PropTypeDefaultDescription
entriesreadonly WaterfallEntry[]RequiredOrdered inputs with unique nonempty id, label, kind and kind-specific value.
initialBalancenumber | null0Balance before the first entry; null means unknown.

Returns WaterfallDatum[] with IDs, labels, kinds, original/computed values, endpoints and balances. range sorts endpoints or becomes null; use value for direction because sorting loses sign.

WaterfallChart

PropTypeDefaultDescription
dataWaterfallDatum[]—Computed or host-owned range rows.
layout"horizontal" | "vertical""horizontal"Vertical bars or horizontal bars, respectively.
animateboolean | BarAnimationfalseChart-owned motion with reduced-motion handling.
barCategoryGapnumber | string"10%"Native category spacing; these components use "32%".
accessibilityLayerbooleantrue in RechartsKeyboard category inspection; set explicitly here.
aria-label / aria-labelledbystring—Accessible plot name, including units.

BarAnimation shares LineAnimation: default duration 1000, easing [0.25, 0.1, 0.25, 1], and supported inspection hoverTransition. See Recharts BarChart.

WaterfallSeries

PropTypeDefaultDescription
seriesKeystring"range"Metadata and controlled visibility identity.
material"plain" | "paper" | "clay" | "glow""plain"Finish on native rectangles; custom shapes/filters retain ownership.
hidebooleanfalseHide all bars; pass the same value to connectors.
radiusnumber | [number, number, number, number]0Native rectangle corner radius.
childrenReactNode—Native Cell and LabelList composition.

Binds range with zero minimum size; rejects data, dataKey, stackId and minPointSize. Native shapes/events remain available. See Recharts Bar and Cell.

WaterfallConnectors

PropTypeDefaultDescription
datareadonly WaterfallDatum[]RequiredThe same ordered rows supplied to the chart.
seriesKeystring"range"Match the bars' visibility identity.
hidebooleanfalseMatch native bar hide state.
position"start" | "middle" | "end""middle" in RechartsCategory-band alignment; set "middle" explicitly here.
xAxisId / yAxisIdstring | number0Match the series' axes.
strokeDasharraystring"3 3"Connector dash pattern.
zIndexnumber100Native layer order; endpoints sit under bars.

Native ReferenceLine segments without pointer capture; x, y, segment and children are excluded. See Recharts ReferenceLine.

Shared components

Root, SeriesConfig, Tooltip, Axes and grid.