# Box plot

> Use a box plot to compare the middle, the spread and the outliers of several groups at once.

- Data type: Many values of one measure (`spread`)
- Free (MIT): install with `npx chartreuse add box-plot`, or registry item `/r/box-plot.json`
- Example: **In the typical European country 92% of people are online; in the typical African one, 38%** (Share of people who used the internet in the last three months, by country, 2023)
- How to read it: Each box holds the middle half of a continent's countries, the thick line is the median, whiskers reach the rest and hollow dots are outliers.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- comparing 3 to 12 groups of numbers
- the middle and the spread matter more than the exact shape
- outliers should stand out

## Avoid it when
- a general audience new to quartiles (use a strip plot)
- the distribution has two peaks (a box hides them; use a violin)
- a group has fewer than about 8 values
- more than 12 groups (the smallest fold into Other)

## Fields (data.json)
- `year` (year): the year shown
- `rows[].country` (place): the country
- `rows[].continent` (category): the group: any labels, one box each; 3 to 12 groups, the smallest fold into Other past 12
- `rows[].share` (number, unit "%", format percent): share of people online, %

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- hover or tap a box for its quartiles
- hover an outlier to see which country it is
- Motion: Each box opens out from its median, one continent after another; outliers appear last.
- Sound: A soft pop on hover, pitched by continent. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "box-plot",
  "title": "In the typical European country 92% of people are online; in the typical African one, 38%",
  "subtitle": "Share of people who used the internet in the last three months, by country, 2023",
  "data": "/charts/box-plot.data.json"
}
```

## Source
Share of the population using the internet, Our World in Data (International Telecommunication Union via World Bank) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/share-of-individuals-using-the-internet

Note: Countries are equal weight: a small island counts as much as India. Continents follow Our World in Data's grouping.

Live: /charts/box-plot · Manifest: /charts/box-plot.json · Tags: quartiles, outliers, groups, internet, technology, comparison, spread
