Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

UN Pop data basic bar chart top 10

Public visualization

Viewing a saved revision (read-only)

2435a329d2cb48b498fe75581f00dae1

UN Pop data basic bar chart top 10

0 stars1🌍 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