All charts/Bars
The energy mix per year
stacked puts the series on top of each other.
1 The data _data/energymix.yaml yaml
# Electricity produced, in terawatt-hours
- year: '2019'
coal: 40
gas: 85
wind: 22
solar: 5
- year: '2020'
coal: 28
gas: 82
wind: 30
solar: 9
- year: '2021'
coal: 31
gas: 75
wind: 35
solar: 12
- year: '2022'
coal: 22
gas: 68
wind: 44
solar: 17
- year: '2023'
coal: 15
gas: 60
wind: 52
solar: 21
2 The chart tag bars/energy.pad pad
{chart 'bar', data='energymix', label='year', value='coal, gas, wind, solar', stacked, title='Electricity by source', width=640, height=340}
3 The result inline SVG · no JavaScript