# Small-multiple bars

> Use small-multiple bars to repeat one simple bar chart per group, so shapes can be compared across groups at a glance.

- Data type: Values per item (`compare`)
- Free (MIT): install with `npx chartreuse add small-multiple-bars`, or registry item `/r/small-multiple-bars.json`
- Example: **Mumbai got more rain in July 2024 than London did all year** (Monthly rainfall, millimetres, 2024, six cities)
- How to read it: Each panel is one city's twelve months of rain on the same scale; the orange bar is its wettest month.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9, 9:16 (best 9:16)

## Use it when
- the same small chart for 4 to 16 groups
- the shape (when, how peaked) matters more than exact values
- one chart with every group on it would be a tangle

## Avoid it when
- groups must be compared value by value (put them on one chart)
- the panels have nothing in common to compare
- there are only two groups (use grouped bars)

## Fields (data.json)
- `city` (place): the panel
- `months` (number, unit "mm", format count): one rainfall total per period, in order, mm (twelve months, January to December, in the example; any count works, named by hints.periods, else month names for twelve, else 1 to N)

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 bar to read that month and its share of the year
- the scale chips switch between one shared scale and a scale per panel
- Motion: The panels fill one after another, each month's bar rising left to right; switching scale stretches the bars in place.
- Sound: A chime on toggle; a pop pitched by month on hover. 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": "small-multiple-bars",
  "title": "Mumbai got more rain in July 2024 than London did all year",
  "subtitle": "Monthly rainfall, millimetres, 2024, six cities",
  "data": "/charts/small-multiple-bars.data.json"
}
```

## Source
Historical Weather API (ERA5 and ERA5-Land reanalysis), daily precipitation_sum, 2024, Open-Meteo (Copernicus Climate Change Service data) (CC BY 4.0), retrieved 2026-12-01: https://open-meteo.com/en/docs/historical-weather-api

Note: Reanalysis rainfall is for a grid cell around each city centre and smooths out local downpours, so it can differ from rain-gauge totals.

Live: /charts/small-multiple-bars · Manifest: /charts/small-multiple-bars.json · Tags: small multiples, trellis, facets, bar chart, rain, weather, monsoon, cities
