Skip to content
ChartslibraryUI Get Pro

Sankey chart

Conserved flows between stages, with cycle checks and in/out balance warnings.

When to use

  • Revenue to costs and profit
  • Budget allocation
  • Traffic to outcomes

When not to use

  • Flows aren't conserved or are cyclical – use Funnel chart
  • Many small flows; it becomes a hairball

Good practice

  • Fix imbalance warnings in the data; they usually mean a missing line.
  • Highlight the path the story is about.

Installation

Sankey chart is a Pro chart.

Installation is part of Pro

The full source is included in the Pro download. Get Pro to install it with the CLI and use it in unlimited projects.

Unlock with Pro
Already have Pro?npx chartslibraryui add sankey-chart --from ./chartslibraryui-pro

Usage

Usage examples are part of Pro

Every example on this page comes with its code in the Pro download. The props and data shape below are public.

Unlock with Pro

Data

An array of links: { source, target, value }.

[{ source: "Revenue", target: "Gross profit", value: 9.2 }, ...]

Missing values are null. Invalid values make the chart say what’s wrong instead of drawing a misleading picture. How charts handle bad data

Props

Every chart also accepts the shared frame props: title, subtitle, source, height, mode, toolbar. Common API

export interface SankeyChartProps extends FrameProps {
  data: SankeyLink[];
  format?: FormatInput;
  /** Nodes to colour with the accent (and their links). */
  highlight?: string[];
  /** Relative tolerance for in/out imbalance warnings. Default 0.005 (0.5%). */
  tolerance?: number;
}
Pro

Funnel chart

Nested stages with step and overall conversion printed.

Pro

Waterfall chart

A bridge from one total to another, with computed subtotals that always close.