Skip to main content
100%

Fork of Pathetic Bar Chart

✓ Published0🌍 Public
AAna Sofia Pinto
Last edited Aug 4, 2022
Created on Aug 4, 2022
Forked from Pathetic Bar Chart

This example displays the top 10 most populous countries as rectangles extending from the left edge, with country names omitted and no axes, creating a deliberately bare "pathetic" bar chart. Data from the United Nations World Population Prospects 2019 is loaded via d3.csv, then sorted and sliced to the first 10 rows. React hooks (useState, useEffect) manage the asynchronous data fetch, while d3.scaleBand and d3.scaleLinear map country names and population values to SVG rectangle positions and widths, rendered directly to the DOM.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes