Waterfall Chart

How a starting value turns into a result step by step — each bar floats from the running total, increases and decreases in their own colours, total bars close a section. Drawn as SVG by the component, rendered on the server and themed by the design tokens.

Part of @tectra-ng/charts (npm install @tectra-ng/charts, also included in tectra-ng).

Features12APIThemingAccessibility

Basic

Each step floats from the running total: increases in green, decreases in red, and total: true draws the running total from zero. Signed labels and dashed connectors show where the next step starts.

IncreaseDecreaseTotalArrow keys move between values
Cash flow for the quarter. Waterfall chart, 1 series, 7 values, total 440K
CategoryChangeTotal
Opening+420K420K
Sales+310K730K
Services+95K825K
Salaries−240K585K
Rent−60K525K
Taxes−85K440K
Closing—440K

Subtotals

Several total steps close sections along the way — gross, operating and net profit — while the running total carries on. Long category labels turn when they do not fit.

IncreaseDecreaseTotalArrow keys move between values
Profit and loss. Waterfall chart, 1 series, 10 values, total 163
CategoryChangeTotal
Revenue+820820
Cost of sales−310510
Gross profit—510
Marketing−140370
Research−95275
Admin−70205
Operating profit—205
Interest+12217
Tax−54163
Net profit—163

Negative

The running total may go below zero: the zero line appears and bars cross it.

IncreaseDecreaseTotalArrow keys move between values
Account balance. Waterfall chart, 1 series, 6 values, total 70
CategoryChangeTotal
Start+4040
Payroll−95-55
Invoices+30-25
Supplier−25-50
Loan+12070
End—70

Plain

dataLabels, connectors and showLegend turn the extras off for a quiet chart; yAxisTitle names the axis.

Arrow keys move between values
Visitors gained and lost by source. Waterfall chart, 1 series, 6 values, total 5,270
CategoryChangeTotal
Last week+5,2005,200
Search+6405,840
Social−3105,530
Email+2205,750
Ads−4805,270
This week—5,270

Colors

color on an item paints one bar in its own colour, whatever its kind.

IncreaseDecreaseTotalArrow keys move between values
Budget by team. Waterfall chart, 1 series, 5 values, total 270
CategoryChangeTotal
Budget+500500
Design−80420
Engineering−210210
Grant+60270
Left—270

Events

barClick reports the clicked step with its change, the running total after it and its kind.

IncreaseDecreaseTotalArrow keys move between values
Click a part. Waterfall chart, 1 series, 5 values, total 150
CategoryChangeTotal
Start+120120
Wins+45165
Losses−30135
Bonus+15150
End—150

Click a bar.

Loading and empty

loading keeps the size with a skeleton; empty items show "No data".

No data

Live

New items redraw in place — bars slide to their new place and the connectors follow.

IncreaseDecreaseTotalArrow keys move between values
Shuffled data. Waterfall chart, 1 series, 6 values, total 180
CategoryChangeTotal
Opening+200200
Q1−33167
Q2−21146
Q3+3149
Q4+31180
Closing—180

Accessibility

Tab to the chart: ←/→ walk the steps and each one is announced with its change and the running total; Home / End jump to the ends. Screen readers also get a summary with the final total and a hidden table.

IncreaseDecreaseTotalArrow keys move between values
Weekly hours. Waterfall chart, 1 series, 4 values, total 38
CategoryChangeTotal
Planned+4040
Meetings−634
Overtime+438
Worked—38

Design tokens

dt sets the increase, decrease and total colours, the connectors and the bar radius and width of one chart.

IncreaseDecreaseTotalArrow keys move between values
Stock movements. Waterfall chart, 1 series, 5 values, total 255
CategoryChangeTotal
On hand+300300
Received+140440
Shipped−210230
Returned+25255
Now—255

Pass through

pt reaches the parts — bar, connector, dataLabel, grid, axis, legend, plot, tooltip and more.

IncreaseDecreaseTotalArrow keys move between values
Points by round. Waterfall chart, 1 series, 4 values, total 17
CategoryChangeTotal
Round 1+1212
Round 2−48
Round 3+917
Score—17

Unstyled

unstyled removes the tectra styles: no tokens, no rounding, no motion — the geometry, the tooltip and the keyboard stay, ready for your own CSS.

IncreaseDecreaseTotalArrow keys move between values
Unstyled chart. Waterfall chart, 1 series, 3 values, total 7
CategoryChangeTotal
A+1010
B−37
Total—7