Skip to main content
100%

D3 Bar chart

✓ Published0🌍 Public
KKelly Egan
Last edited Apr 1, 2021
Created on Apr 1, 2021

This example displays a horizontal bar chart of United Nations population estimates for 2020, using React to manage state and render SVG rectangles. The code loads CSV data via `d3.csv`, then maps country names to a `scaleBand` y-axis and population values to a `scaleLinear` x-axis. Each bar’s width is set by the scaled population, with heights determined by `yScale.bandwidth()`. The chart updates once data arrives, showing a loading message until then.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes