# Range bars

> Use range bars to show each item's minimum to maximum with a typical value marked, so spread and centre read together.

- Data type: Values per item (`compare`)
- Free (MIT): install with `npx chartreuse add range-bars`, or registry item `/r/range-bars.json`
- Example: **Yakutsk's 2024 swung 82 °C from coldest night to hottest day; Singapore's barely 13** (Lowest and highest temperature of 2024 and the year's mean, twelve cities, °C)
- How to read it: Each bar runs from a city's coldest night (left) to its hottest day (right) in 2024; the ringed dot is the year's mean.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- each item has a low, a high and a typical value
- the spread matters as much as the level
- up to about 20 items on one scale

## Avoid it when
- you need the whole distribution, not just its ends (use a box or strip plot)
- the extremes are outliers that hide the usual range
- items are in different units

## Fields (data.json)
- `city` (place): the city
- `min` (number, unit "°C", format decimal): lowest daily minimum temperature of 2024, °C
- `minDate` (date): the day of the minimum
- `max` (number, unit "°C", format decimal): highest daily maximum temperature of 2024, °C
- `maxDate` (date): the day of the maximum
- `mean` (number, unit "°C", format decimal): mean of the daily mean temperatures in 2024, °C

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 city to read its extremes, their dates and its mean
- Motion: Each range stretches out from the city's mean to both extremes, widest first.
- Sound: A pop pitched by row 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": "range-bars",
  "title": "Yakutsk's 2024 swung 82 °C from coldest night to hottest day; Singapore's barely 13",
  "subtitle": "Lowest and highest temperature of 2024 and the year's mean, twelve cities, °C",
  "data": "/charts/range-bars.data.json"
}
```

## Source
Historical Weather API (ERA5 and ERA5-Land reanalysis), daily temperature_2m_min, _max and _mean, 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 values are for a grid cell around each city centre, so they can differ from a single weather station's record.

Live: /charts/range-bars · Manifest: /charts/range-bars.json · Tags: range bars, floating bars, min max, temperature, weather, climate, cities
