# Energy mix (Waffle example)

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

100 cells, one per percent of generation.

Why it matters: exactly 100 cells via largest-remainder rounding; filled bottom-up; legend toggles re-flow

- Chart type: `waffle` (Waffle)
- Collection: Waffle · Waffle
- Raw configuration: https://westcoast-charts.com/gallery-src/waffle/energy-mix.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/waffle/energy-mix.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: 400,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "waffle",
    toolbar: {
      show: false
    }
  },
  series: [31.4, 22.7, 18.2, 12.9, 9.6, 5.2],
  labels: ["Wind", "Solar", "Gas", "Hydro", "Nuclear", "Coal"],
  colors: ["#0ea5e9", "#f59e0b", "#94a3b8", "#2563eb", "#7c3aed", "#475569"],
  plotOptions: {
    unit: {
      grid: {
        total: 100
      }
    }
  },
  title: {
    text: "Electricity generation 2026 (%)"
  },
  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 waffle-energy-mix.json --out waffle-energy-mix.svg --with-table` (save the options above as JSON first)
