# 100% stacked bar (Bar example)

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

Survey answers per question as shares.

- Chart type: `bar` (Bar)
- Collection: Bar · Bar
- Raw configuration: https://westcoast-charts.com/gallery-src/bar/stacked-bar-100.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/bar/stacked-bar-100.html

## Setup

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

## Options

```js
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "bar",
    stacked: true,
    stackType: "100%",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Disagree",
      data: [24, 51, 51, 47, 28]
    },
    {
      name: "Neutral",
      data: [25, 42, 16, 39, 40]
    },
    {
      name: "Agree",
      data: [13, 55, 27, 33, 39]
    }
  ],
  colors: ["#e11d48", "#94a3b8", "#0d9488"],
  xaxis: {
    categories: ["Easy to start", "Fast", "Good docs", "Fair price", "Would recommend"]
  },
  plotOptions: {
    bar: {
      horizontal: true,
      barHeight: "58%"
    }
  },
  title: {
    text: "Survey: agreement by statement"
  },
  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 bar-stacked-bar-100.json --out bar-stacked-bar-100.svg --with-table` (save the options above as JSON first)
