WaterfallChart

Steps float on the running total: gains rise, losses drop, totals anchor to the floor. Charts.

Open playground
Start
New
Upsell
Churn
Refunds
End

About

WaterfallChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { WaterfallChart } from "@ashutoshswamy/smoui" and set data, prefix.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { WaterfallChart } from "@ashutoshswamy/smoui";

<WaterfallChart data={[{ label: "Start", value: 120, total: true }, { label: "Churn", value: -31 }, { label: "End", value: 89, total: true }]} />

Props 2

data

Deltas from the running total. `total` draws from zero.

{ label; value; total? }[]
prefix / suffix

Wrap values, or pass `format`.

string