Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pathetic Bar Chart

Public visualization

Viewing a saved revision (read-only)

e198cc47e93a4fce825fd0200dd04562

Pathetic Bar Chart

0 stars1🌍 Public
JJeff Wagner
Last edited Jun 8, 2023
Created on Jun 7, 2023
Forked from React Starter

This example displays a bar chart of the 2020 populations for the ten most populous countries, sourced from a UN dataset loaded via `d3.csv`. The bars are rendered as SVG `<rect>` elements, with each country's bar width mapped to its population using `d3.scaleLinear` and the vertical position and height determined by `d3.scaleBand`. The chart updates on load after fetching the CSV, initially showing a loading message. The React application uses functional state with `useState` and `useEffect` to manage data fetching and rendering.

AI-generated description

React Starter code.