Skip to main content
100%

Refactored React Bar Chart

✓ Published1🌍 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.

MIT Licensed

Similar vizzes