# Basic waterfall (Waterfall example)

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

Opening to closing cash with subtotals.

Why it matters: real waterfall type: auto subtotals/totals, connectors, rise/fall/total colours, signed compact labels with typographic minus

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

## Setup

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

WestCoastCharts.use(types)
```

## Options

```js
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "waterfall",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Cash k€",
      data: [
        {
          x: "Opening",
          y: 420
        },
        {
          x: "Sales",
          y: 260
        },
        {
          x: "Services",
          y: 85
        },
        {
          x: "Salaries",
          y: -210
        },
        {
          x: "Rent",
          y: -48
        },
        {
          x: "Q1",
          isSubtotal: true
        },
        {
          x: "Tax",
          y: -62
        },
        {
          x: "Grants",
          y: 40
        },
        {
          x: "Closing",
          isTotal: true
        }
      ]
    }
  ],
  title: {
    text: "Cash bridge Q1–Q2 (k€)"
  },
  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 waterfall-basic-waterfall.json --out waterfall-basic-waterfall.svg --with-table` (save the options above as JSON first)
