Skip to main content
100%

margin convention bar chart

✓ Published1🌍 Public
GGuitong Li
Last edited Feb 5, 2022
Created on Feb 4, 2022
Forked from scaling bar chart

This bar chart displays the population of the top 10 most populous countries using 2018 estimates from the United Nations World Population Prospects. The visualization demonstrates the margin convention by applying a 20-pixel margin around a 500-pixel SVG canvas, with the inner chart area offset via a translate transform. Built with React and D3 v5, it uses `scaleBand` for the categorical y-axis, `scaleLinear` for the numeric x-axis, and `csv()` to load remote data. Rectangles are rendered per country with widths proportional to population, while the axes styling shows customization through CSS tick and text formatting.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.

See also the first bar chart visualization that this one builds on: Making a Bar Chart.

MIT Licensed

Similar vizzes