# Flow bars

> Use flow bars to show what comes in and what goes out at each stage as a pair of bars, so the net change is the gap between them.

- Data type: Movement between stages (`flow`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`flow`)
- Example: **Deaths are projected to outnumber births worldwide from the 2080s** (People born and people who died worldwide, per decade, 1950s–2090s; UN medium projection after 2023)
- How to read it: Bars above the line are births in each decade and bars below are deaths; the dotted line is the net change, which crosses zero in the 2080s.
- Phone: Not recommended for mobile (2 labels overlap on a phone) · Video formats: 16:9 (best 16:9)

## Use it when
- each stage has an inflow and an outflow
- the balance between in and out is the story
- there are 4 to 20 stages

## Avoid it when
- there is no natural in and out (use grouped bars)
- you need to show where the flow goes next (use a Sankey)
- the stages are not in an order
- more than about 20 stages (labels thin out)

## Fields (data.json)
- `decades[].decade` (year): the period, in order: its first year (decades show as 1950s) or any label
- `decades[].births` (number, unit "people", format count): what came in during the period (named by hints.inWord and inNoun)
- `decades[].deaths` (number, unit "people", format count): what went out during the period (named by hints.outWord and outNoun)
- `decades[].projectedYears` (number, unit "years", format count): how many of the period's years are projections (0 to hints.periodYears; optional)
- `lastEstimate` (year): the last year of estimates (optional)

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 period to read births, deaths and the net change
- Motion: Births grow up from the line and deaths grow down, decade by decade; then the net line appears.
- Sound: A pop 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": "flow-bars",
  "title": "Deaths are projected to outnumber births worldwide from the 2080s",
  "subtitle": "People born and people who died worldwide, per decade, 1950s–2090s; UN medium projection after 2023",
  "data": "/charts/flow-bars.data.json"
}
```

## Source
Births and deaths, projected to 2100, Our World in Data, from UN World Population Prospects (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/births-and-deaths-projected-to-2100

Note: Decade totals are sums of the yearly figures. The 2020s mix estimates (to 2023) and projections; later decades are the UN medium projection, which is uncertain.

Live: /charts/flow-bars · Manifest: /charts/flow-bars.json · Tags: in and out, inflow, outflow, population, births, deaths, demography, projection
