Waterfall chart

Cumulative running-total bar chart with positive / negative deltas and total bars. Self-contained SVG (no ChartRoot).

Primitive: ChartWaterfall· Standalone (no ChartRoot needed)

Interactive demo

Usage

import { ChartWaterfall } from '@ramtt/charts'

<ChartWaterfall
  data={[
    { label: 'Start', value: 100, type: 'total' },
    { label: 'Sales', value: 50, type: 'increase' },
    { label: 'Costs', value: -20, type: 'decrease' },
    { label: 'End', value: 130, type: 'total' },
  ]}
/>

Props

PropTypeDefaultDescription
data*WaterfallItem[]Bars with type "increase" | "decrease" | "total"
widthnumber600SVG width in px
heightnumber300SVG height in px
radiusnumber2Bar corner radius
gapnumber0.35Gap as fraction of bar slot width
positiveClassNamestringTailwind class for positive bars
negativeClassNamestringTailwind class for negative bars