Skip to main content
100%

Fork of United Nations Bar Chart (Margin Convention)

✓ Published1🌍 Public
RRichardPearce60
Last edited Jan 30, 2022
Created on Jan 30, 2022

This example displays a horizontal bar chart of the top 10 most populous countries in 2020, using data from the United Nations population dataset. The chart applies the margin convention to create space for axes and labels, with bars sized proportionally to population values. Built with React and D3 v7, it loads the CSV data asynchronously using `d3.csv`, scales the bar lengths with `d3.scaleLinear`, and positions countries vertically using `d3.scaleBand`. The visualization renders as SVG, with each bar drawn as a `rect` element inside a translated group.

AI-generated description
MIT Licensed

Similar vizzes