Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored React Bar Chart

Public visualization

Viewing a saved revision (read-only)

b3d73056bf694b94b7c055c097d410d0

Refactored React Bar Chart

0 stars1🌍 Public
AAnthony Ynami
Last edited Feb 19, 2021
Created on Feb 19, 2021
Forked from Axes w/ React

This example shows the population of the ten most populous countries in 2020, using data from the United Nations World Population Prospects. A React component renders an SVG bar chart where each country’s bar length is proportional to its population. The code uses `d3.csv` to load the data, `d3.scaleLinear` and `d3.scaleBand` to position bars, and separate React components for the axes and marks. The bottom axis uses `xScale.ticks()`, while the left axis displays country names, with bars styled in steel blue.

AI-generated description

This bar chart shows the population of the top 10 most populous countries . The data comes from the year 2020 estimate in United Nations: World Population Prospects 2020.