Skip to main content
100%

Fork of Population Bar Chart Basic

✓ Published1🌍 Public
SSam Hege
Last edited Sep 13, 2022
Created on Sep 13, 2022

This example displays a horizontal bar chart of the top 10 countries by population for 2020. It uses React hooks to load and store the data, which comes from a CSV file of United Nations population estimates. The chart renders as SVG rectangles, with scales created using `d3.scaleBand` and `d3.scaleLinear` to map country names and population values to pixel positions. The `d3.csv` method parses the data, and the `xScale` and `yScale` dimensions are set to fixed width and height values.

AI-generated description

A program that loads and visualizes some data

MIT Licensed

Similar vizzes