Population pyramid
A population pyramid compares two groups across mirrored bands on one scale, such as age bands by sex, with the youngest band always at the bottom.
- React
import { PyramidChart } from 'boardplot/react/pyramid';- Reference
- Data, options and sizing
- Use for
- Population by age and sex · Mirrored distribution · Customer age by gender
- Not for
- More than two groups or unordered bands; pyramid mirrors two groups over contiguous ordered bands.
Workforce by tenure and gender
Population pyramid of headcount share by tenure band from 0 to 16 years; women hold 45.1% and men 54.9%, and women lead below four years but trail from ten years.
workforce-tenure-gender
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: options.size from the report frame to the width of the site frame.
{
"type": "pyramid",
"data": {
"bands": [
{
"id": "t0",
"from": 0,
"to": 2,
"label": "0–2 yrs"
},
{
"id": "t2",
"from": 2,
"to": 4,
"label": "2–4 yrs"
},
{
"id": "t4",
"from": 4,
"to": 6,
"label": "4–6 yrs"
},
{
"id": "t6",
"from": 6,
"to": 8,
"label": "6–8 yrs"
},
{
"id": "t8",
"from": 8,
"to": 10,
"label": "8–10 yrs"
},
{
"id": "t10",
"from": 10,
"to": 12,
"label": "10–12 yrs"
},
{
"id": "t12",
"from": 12,
"to": 14,
"label": "12–14 yrs"
},
{
"id": "t14",
"from": 14,
"to": 16,
"label": "14–16 yrs"
}
],
"groups": [
{
"id": "w",
"label": "Women",
"values": [
420,
355,
268,
196,
132,
84,
47,
26
]
},
{
"id": "m",
"label": "Men",
"values": [
388,
341,
289,
241,
205,
168,
131,
96
]
}
]
},
"options": {
"basis": "shareOfTotal",
"title": "Women form a smaller share of the long-tenure workforce",
"subtitle": {
"measure": "Headcount",
"period": "FY25"
},
"source": "HR extract, all offices",
"size": {
"width": 1000
}
}
}Age structure by sex
Population pyramid with 18 five-year age bands in thousands for men and women; the 45 to 54 bands are the widest, at about 3,300 each sex.
germany-age-structure
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: options.size from {"width":960,"height":539} to the width of the site frame.
{
"type": "pyramid",
"data": {
"bands": [
{
"id": "a0",
"from": 0,
"to": 5,
"label": "0–4"
},
{
"id": "a5",
"from": 5,
"to": 10,
"label": "5–9"
},
{
"id": "a10",
"from": 10,
"to": 15,
"label": "10–14"
},
{
"id": "a15",
"from": 15,
"to": 20,
"label": "15–19"
},
{
"id": "a20",
"from": 20,
"to": 25,
"label": "20–24"
},
{
"id": "a25",
"from": 25,
"to": 30,
"label": "25–29"
},
{
"id": "a30",
"from": 30,
"to": 35,
"label": "30–34"
},
{
"id": "a35",
"from": 35,
"to": 40,
"label": "35–39"
},
{
"id": "a40",
"from": 40,
"to": 45,
"label": "40–44"
},
{
"id": "a45",
"from": 45,
"to": 50,
"label": "45–49"
},
{
"id": "a50",
"from": 50,
"to": 55,
"label": "50–54"
},
{
"id": "a55",
"from": 55,
"to": 60,
"label": "55–59"
},
{
"id": "a60",
"from": 60,
"to": 65,
"label": "60–64"
},
{
"id": "a65",
"from": 65,
"to": 70,
"label": "65–69"
},
{
"id": "a70",
"from": 70,
"to": 75,
"label": "70–74"
},
{
"id": "a75",
"from": 75,
"to": 80,
"label": "75–79"
},
{
"id": "a80",
"from": 80,
"to": 85,
"label": "80–84"
},
{
"id": "a85",
"from": 85,
"label": "85+"
}
],
"groups": [
{
"id": "m",
"label": "Men",
"values": [
1875,
1980,
2010,
2115,
2450,
2570,
2610,
2665,
2915,
3350,
3290,
2905,
2540,
2450,
2250,
1720,
1180,
690
]
},
{
"id": "f",
"label": "Women",
"values": [
1780,
1880,
1905,
1990,
2255,
2380,
2455,
2545,
2810,
3255,
3225,
2895,
2560,
2530,
2400,
1950,
1520,
1520
]
}
]
},
"options": {
"size": {
"width": 1000
},
"title": "A mature European age structure, by sex",
"subtitle": {
"measure": "Population",
"period": "2023"
},
"unit": "thousands",
"source": "Stylised five-year age profile — illustrative, not an official statistical series"
}
}Age bands across two years
Pyramid of residents by age band for FY21 and FY23; the under-20 band grows from 100 to 144, marked as 20% a year, and 20 to 39 grows by 30.
dated-population-comparison
JSON spec
This spec includes the theme shown and the options you selected.
Changed from the fixture: options.size from {"width":1000,"height":500} to the width of the site frame.
{
"type": "pyramid",
"data": {
"bands": [
{
"id": "young",
"from": 0,
"to": 20,
"label": "0 to 19"
},
{
"id": "adult",
"from": 20,
"to": 40,
"label": "20 to 39"
},
{
"id": "older",
"from": 40,
"to": 60,
"label": "40 to 59"
}
],
"groups": [
{
"id": "before",
"label": "FY21",
"date": "2021-12-31",
"values": [
100,
120,
80
]
},
{
"id": "after",
"label": "FY23",
"date": "2023-12-31",
"values": [
144,
150,
100
]
}
]
},
"options": {
"size": {
"width": 1000
},
"methodNote": true,
"title": "Residents aged under 20 grew 20% a year",
"subtitle": {
"measure": "Residents by age band",
"period": "FY21 to FY23"
},
"source": "Illustrative town population snapshots",
"annotations": [
{
"id": "growth",
"kind": "cagr",
"from": {
"categoryId": "young",
"seriesId": "before"
},
"to": {
"categoryId": "young",
"seriesId": "after"
}
},
{
"id": "gap",
"kind": "diff",
"mode": "absolute",
"from": {
"categoryId": "adult",
"seriesId": "before"
},
"to": {
"categoryId": "adult",
"seriesId": "after"
}
}
]
}
}Minimal spec
Save this spec as pyramid.json and run the command.
{
"type": "pyramid",
"data": {
"bands": [
{ "id": "junior", "from": 0, "to": 5 },
{ "id": "senior", "from": 5, "to": 10 },
{ "id": "long", "from": 10, "to": 15 }
],
"groups": [
{ "id": "north", "label": "North", "values": [40, 30, 20] },
{ "id": "south", "label": "South", "values": [35, 25, 15] }
]
},
"options": {
"title": "North has more employees in every tenure band",
"unit": "employees",
"source": "Illustrative data"
}
}npx boardplot render pyramid.json --out pyramid.svg