Skip to main content
100%

UN Pop data basic bar chart top 10

✓ Published1🌍 Public
Jjackcaldwellnichols
Last edited Nov 8, 2023
Created on Nov 8, 2023

This example displays the top 10 countries by 2020 population from a UN population prospects CSV, rendered as horizontal bars in an SVG. It uses React with D3 v7, loading and slicing the data via `d3.csv`, then mapping it through `scaleBand` for the y-axis and `scaleLinear` for the bar widths. The chart updates responsively, showing each country’s name alongside its population, with the data retrieved from a GitHub gist.

AI-generated description

Rendering the CSV colors in react

MIT Licensed

Similar vizzes