# Box plot with outliers (Boxplot example)

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

Boxes plus outliers drawn as a scatter series.

- Chart type: `boxPlot` (Box Plot)
- Collection: Boxplot · Box plot
- Raw configuration: https://westcoast-charts.com/gallery-src/boxplot/boxplot-scatter.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/boxplot/boxplot-scatter.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: "boxPlot",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Response",
      type: "boxPlot",
      data: [
        {
          x: "2022",
          y: [26, 35.8, 40.3, 44.4, 53.7]
        },
        {
          x: "2023",
          y: [25.7, 37.3, 40.7, 46.8, 56.1]
        },
        {
          x: "2024",
          y: [35.1, 43.8, 46.1, 49.3, 58.7]
        },
        {
          x: "2025",
          y: [38, 45.6, 49.9, 52.5, 63.8]
        },
        {
          x: "2026",
          y: [41.8, 47.4, 51.7, 55.6, 70.7]
        }
      ]
    },
    {
      name: "Outliers",
      type: "scatter",
      data: [
        {
          x: "2022",
          y: 61.9
        },
        {
          x: "2022",
          y: 20
        },
        {
          x: "2023",
          y: 65.3
        },
        {
          x: "2023",
          y: 19.7
        },
        {
          x: "2024",
          y: 67.9
        },
        {
          x: "2024",
          y: 29.1
        },
        {
          x: "2025",
          y: 74.4
        },
        {
          x: "2025",
          y: 32
        },
        {
          x: "2026",
          y: 79.1
        },
        {
          x: "2026",
          y: 35.8
        }
      ]
    }
  ],
  markers: {
    size: 5
  },
  tooltip: {
    shared: false,
    intersect: true
  },
  title: {
    text: "Survey score with outliers"
  },
  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 boxplot-boxplot-scatter.json --out boxplot-boxplot-scatter.svg --with-table` (save the options above as JSON first)
