Browse Components
Waterfall
Explain changes from an opening value to a final total.
Basic
Hover, tap or focus a mark to inspect exact values. Arrow keys move between observations.
| Observation | Change |
|---|---|
| Opening | 120 |
| Sales | 75 |
| Services | 32 |
| Payroll | -58 |
| Tools | -14 |
| Tax | -22 |
View Code
<figure class="chart" data-chart="waterfall">
<figcaption>
Monthly balance
</figcaption>
<div class="chart-data">
<table>
<caption>
Monthly balance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Change
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
Opening
</th>
<td>
120
</td>
</tr>
<tr>
<th scope="row">
Sales
</th>
<td>
75
</td>
</tr>
<tr>
<th scope="row">
Services
</th>
<td>
32
</td>
</tr>
<tr>
<th scope="row">
Payroll
</th>
<td>
-58
</td>
</tr>
<tr>
<th scope="row">
Tools
</th>
<td>
-14
</td>
</tr>
<tr>
<th scope="row">
Tax
</th>
<td>
-22
</td>
</tr>
</tbody>
</table>
</div>
</figure>Right-to-left
Labels follow the reading direction. Numeric and radial axes keep their established orientation.
| Observation | Change |
|---|---|
| Opening | 120 |
| Sales | 75 |
| Services | 32 |
| Payroll | -58 |
| Tools | -14 |
| Tax | -22 |
View Code
<figure class="chart" dir="rtl" data-chart="waterfall">
<figcaption>
Monthly balance
</figcaption>
<div class="chart-data">
<table>
<caption>
Monthly balance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Change
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
Opening
</th>
<td>
120
</td>
</tr>
<tr>
<th scope="row">
Sales
</th>
<td>
75
</td>
</tr>
<tr>
<th scope="row">
Services
</th>
<td>
32
</td>
</tr>
<tr>
<th scope="row">
Payroll
</th>
<td>
-58
</td>
</tr>
<tr>
<th scope="row">
Tools
</th>
<td>
-14
</td>
</tr>
<tr>
<th scope="row">
Tax
</th>
<td>
-22
</td>
</tr>
</tbody>
</table>
</div>
</figure>Empty data
The chart keeps its reserved space without inventing observations.
| Observation | Change |
|---|
View Code
<figure
class="chart"
data-chart-labels="["Opening", "Sales", "Services", "Payroll", "Tools", "Tax"]"
data-chart="waterfall"
>
<figcaption>
Monthly balance
</figcaption>
<div class="chart-data">
<table>
<caption>
Monthly balance — example data
</caption>
<thead>
<tr>
<th scope="col">
Observation
</th>
<th scope="col">
Change
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</figure>Installation
Download these files into the matching paths in your project, or use Create to assemble a kit. Include each dependency once. Do not also load app.css.
<link rel="stylesheet" href="/library/assets/base.css">
<link rel="stylesheet" href="/library/assets/chart-core.css">
<link rel="stylesheet" href="/library/assets/chart-plots.css">
<link rel="stylesheet" href="/library/assets/waterfall-chart.css">
<script defer src="/library/assets/chart-core.js"></script>
<script defer src="/library/assets/chart-plots.js"></script>
<script defer src="/library/assets/waterfall-chart.js"></script>12,194 bytes CSS including base · 16,484 bytes runtime JavaScript
Usage
Data format
One column of signed changes, including the opening balance as the first change. The final Total is calculated automatically; do not add a total row to the table. Connectors show intermediate balances. Positive, negative and total bars use distinct series colors.
Shared interactions
Hover, tap or focus a mark to inspect its exact value. Arrow keys, Home and End move between marks; Escape dismisses the tooltip. The source table remains available without JavaScript. Enhanced charts expose exact values through accessible marks and tooltips.
Lifecycle and themes
Load Chart Core, Chart Plots and this component module. Theme tokens supply colors in light and dark modes. Use layoutCharts.refresh(root) after changing the table and destroy(root) before unmounting. Wide charts scroll within their frame.
Building with AI? The AI Manifest has these notes and the full contract. See the AI Guide.