# Basic Sankey (Sankey example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/sankey/basic-sankey/ · Index for agents: https://westcoast-charts.com/llms.txt

Where a household budget goes: income sources into spending categories.

- Chart type: `sankey` (Sankey)
- Collection: Sankey · Sankey
- Raw configuration: https://westcoast-charts.com/gallery-src/sankey/basic-sankey.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/premium/sankey/basic-sankey.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'

WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
```

## Options

```js
const options = {
  chart: {
    height: 420,
    toolbar: {
      show: false
    },
    type: "sankey"
  },
  series: [
    {
      name: "Budget",
      data: [
        ["Salary", "Household", 3900],
        ["Freelance", "Household", 850],
        ["Interest", "Household", 120],
        ["Household", "Housing", 1650],
        ["Household", "Food", 720],
        ["Household", "Transport", 380],
        ["Household", "Savings", 1300],
        ["Household", "Leisure", 520],
        ["Household", "Other", 300]
      ]
    }
  ],
  plotOptions: {
    sankey: {
      labels: {
        valueFormatter: (v) => '€' + v.toLocaleString('en')
      }
    }
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export sankey-basic-sankey.json --out sankey-basic-sankey.svg --with-table` (save the options above as JSON first)
