Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Bar chart

Public visualization

Viewing a saved revision (read-only)

15d18d25a39241f0bdde9405ab97f38a

D3 Bar chart

0 stars0🌍 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.