Skip to content

Waterfall

Show how positive and negative changes build to a result.

Chart ID: waterfall. Independent import: @revolist/charts/waterfall.

Loading chart…

Follow positive and negative contributions to a running total. Subtotal and grand-total categories summarize accumulated values without adding their source value as another delta.

Use one category per row and one or more numeric series. Values are finite numbers or explicit nulls; the row mapper does not group or aggregate repeated keys.

The roles below describe the chart's data contract. Generic category/value roles resolve from the dataset; explicitly bind specialized numeric roles as shown in the complete example.

Data roleField count
category1 or more
value1 or more
series1

Download the complete sample data and settings (JSON). See Data & Configuration for mapping, null values, updates and lifecycle rules.

Install the package using the installation guide, give the host an explicit height, and call createWaterfallChart after the host mounts. This factory fixes the chart type to waterfall.

<div id="chart" style="width: 100%; height: 450px;"></div>
Complete runnable TypeScript example with sample data
import { createWaterfallChart } from '@revolist/charts/waterfall';
const container = document.getElementById('chart')!;
const chart = await createWaterfallChart({
container,
"dataset": {
"revision": 0,
"source": "client",
"categories": [
{
"id": "preview-category-0",
"label": "Start",
"path": [
"Start"
],
"labels": [
"Start"
],
"depth": 1,
"kind": "leaf"
},
{
"id": "preview-category-1",
"label": "Growth",
"path": [
"Growth"
],
"labels": [
"Growth"
],
"depth": 1,
"kind": "leaf"
},
{
"id": "preview-category-2",
"label": "Cost",
"path": [
"Cost"
],
"labels": [
"Cost"
],
"depth": 1,
"kind": "leaf"
},
{
"id": "preview-category-3",
"label": "Finish",
"path": [
"Finish"
],
"labels": [
"Finish"
],
"depth": 1,
"kind": "leaf"
}
],
"series": [
{
"id": "preview-series-0",
"label": "Value",
"columnPath": [
"Value"
],
"labels": [
"Value"
],
"kind": "leaf",
"prop": "preview-0"
}
],
"values": [
[
48
],
[
24
],
[
-13
],
[
59
]
],
"analyticalFrame": {
"fields": [
{
"id": "pivot:category",
"label": "pivot:category",
"role": "dimension",
"semanticType": "category"
},
{
"id": "pivot:series",
"label": "pivot:series",
"role": "dimension",
"semanticType": "category"
},
{
"id": "preview-series-0",
"label": "Value",
"role": "measure",
"semanticType": "number",
"sourceField": "preview-0"
}
],
"observations": [
{
"id": "[\"preview-category-0\",\"preview-series-0\"]",
"dimensions": {
"pivot:category": {
"value": "Start",
"label": "Start",
"path": [
"Start"
],
"labels": [
"Start"
]
},
"pivot:series": {
"value": "Value",
"label": "Value",
"path": [
"Value"
],
"labels": [
"Value"
]
}
},
"measures": {
"preview-series-0": 48
}
},
{
"id": "[\"preview-category-1\",\"preview-series-0\"]",
"dimensions": {
"pivot:category": {
"value": "Growth",
"label": "Growth",
"path": [
"Growth"
],
"labels": [
"Growth"
]
},
"pivot:series": {
"value": "Value",
"label": "Value",
"path": [
"Value"
],
"labels": [
"Value"
]
}
},
"measures": {
"preview-series-0": 24
}
},
{
"id": "[\"preview-category-2\",\"preview-series-0\"]",
"dimensions": {
"pivot:category": {
"value": "Cost",
"label": "Cost",
"path": [
"Cost"
],
"labels": [
"Cost"
]
},
"pivot:series": {
"value": "Value",
"label": "Value",
"path": [
"Value"
],
"labels": [
"Value"
]
}
},
"measures": {
"preview-series-0": -13
}
},
{
"id": "[\"preview-category-3\",\"preview-series-0\"]",
"dimensions": {
"pivot:category": {
"value": "Finish",
"label": "Finish",
"path": [
"Finish"
],
"labels": [
"Finish"
]
},
"pivot:series": {
"value": "Value",
"label": "Value",
"path": [
"Value"
],
"labels": [
"Value"
]
}
},
"measures": {
"preview-series-0": 59
}
}
],
"matrixCells": [
{
"categoryId": "preview-category-0",
"seriesId": "preview-series-0",
"observationId": "[\"preview-category-0\",\"preview-series-0\"]",
"measureFieldId": "preview-series-0"
},
{
"categoryId": "preview-category-1",
"seriesId": "preview-series-0",
"observationId": "[\"preview-category-1\",\"preview-series-0\"]",
"measureFieldId": "preview-series-0"
},
{
"categoryId": "preview-category-2",
"seriesId": "preview-series-0",
"observationId": "[\"preview-category-2\",\"preview-series-0\"]",
"measureFieldId": "preview-series-0"
},
{
"categoryId": "preview-category-3",
"seriesId": "preview-series-0",
"observationId": "[\"preview-category-3\",\"preview-series-0\"]",
"measureFieldId": "preview-series-0"
}
]
}
},
"bindings": {},
"presentation": {
"dataLabels": false
}
});
// When the host unmounts:
// chart.destroy();

Await updates before reading a snapshot or exporting. Call chart.destroy() when the host unmounts. See the live catalog to interact with this type.

Set these fields in chartOptions. The option schema validates supported keys, ranges and choices; updating chartOptions replaces that authored object.

OptionDefaultAccepted values
showGridLinestruetrue or false
markOpacity10.2 to 1; step 0.05
orientationverticalvertical, horizontal

Titles, legends, theme and labels belong to presentation or the corresponding top-level setting. Axis, color, navigation and interaction support depends on the selected chart; see Data & Configuration.

Charts overview · Installation · Data & Configuration