Box plot with outliers
Boxes plus outliers drawn as a scatter series.
Open the chart without page chrome ↗
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)
chart.render()import WestCoastCharts from 'west-coast-charts'
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() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export boxplot-boxplot-scatter.json --out boxplot-boxplot-scatter.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/boxplot/boxplot-scatter/index.md …