🌍 Public
Viewing a saved revision (read-only)
4ae30f42440f42c38075ca2ce2e0ab12
Fork of 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 descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.