Skip to content

Getting Started

chartjs-chart-sankey is a Chart.js extension for rendering sankey diagrams.

Terminal window
npm install chart.js chartjs-chart-sankey

Register the controller and the elements when using the ESM package entry. NodeElement is the element of a node; a chart also works when only the controller and Flow are registered.

import { Chart } from 'chart.js'
import { Flow, NodeElement, SankeyController } from 'chartjs-chart-sankey'
Chart.register(SankeyController, Flow, NodeElement)

Continue with the editable basic Sankey sample.