# Scatter

> Use a scatter to show how two measures relate across many items, and to spot the ones that break the pattern.

- Data type: Several measures per item (`relationships`)
- Free (MIT): install with `npx chartreuse add scatter`, or registry item `/r/scatter.json`
- Example: **Switzerland is richer per person than the US, yet emits a quarter of the CO2** (GDP per person (international $, PPP) and CO2 emissions per person (tonnes), 2022, 194 countries)
- How to read it: Each dot is a country: further right is richer, higher emits more CO2 per person; both axes are logarithmic.
- Phone: Not recommended for mobile (On a phone labels are hard to read or overlap (checked by eye)) · Video formats: 16:9 (best 16:9)

## Use it when
- two numeric measures per item and you want to see if they move together
- there are 20 to a few thousand items
- the outliers matter as much as the trend

## Avoid it when
- one of the measures is a category (use bars or a strip)
- only a handful of items (use a labelled scatter or a dot plot)
- the items are points in time (use a connected scatter or a line)
- more than six colour groups (the rest share one grey "other")

## Fields (data.json)
- `country` (category): the item
- `continent` (category): colour group: any labels; up to six get their own colour, the rest share one grey "other"
- `gdp` (number, unit "USD", format currency): GDP per person, international $ at 2021 prices (PPP)
- `co2` (number, unit "tonnes", format count): fossil and industry CO2 emissions per person, tonnes

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 dot to read the country, its CO2 and its GDP
- hover a continent in the key to light only its countries
- Motion: Dots rise from the floor to their places, poorest first, so the upward slope draws itself; the callout labels fade in last.
- Sound: A 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": "scatter",
  "title": "Switzerland is richer per person than the US, yet emits a quarter of the CO2",
  "subtitle": "GDP per person (international $, PPP) and CO2 emissions per person (tonnes), 2022, 194 countries",
  "data": "/charts/scatter.data.json"
}
```

## Source
CO2 emissions per capita; GDP per capita, PPP (constant 2021 international $), Our World in Data (Global Carbon Budget 2026; World Bank) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/co-emissions-per-capita

Note: Territorial emissions from fossil fuels and industry; they exclude land use and emissions embedded in imports.

Live: /charts/scatter · Manifest: /charts/scatter.json · Tags: scatter, correlation, two measures, outliers, log scale, climate, emissions
