Skip to main content
100%

Fork of Pathetic Bar Chart

✓ Published0🌍 Public
Vvram80
Last edited Feb 28, 2021
Created on Feb 28, 2021
Forked from Pathetic Bar Chart

This example displays the ten most populous countries as horizontally oriented bars without axes or labels, using a simple SVG bar chart. It loads United Nations World Population Prospects 2019 data via `d3.csv`, then sorts the first ten rows by population. React state management with `useState` and `useEffect` handles the asynchronous data loading, while D3’s `scaleBand` and `scaleLinear` map countries and population values to screen coordinates. The bars are rendered as SVG `<rect>` elements, with each bar’s width proportional to its country’s 2020 population estimate.

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