Skip to main content
100%

Simple Bar Chart

✓ Published1🌍 Public
Ttorstenaan
Last edited Feb 25, 2021
Created on Feb 25, 2021

This example shows a simple horizontal bar chart ranking the ten most populous countries for 2020, with the length of each bar proportional to the country’s population. The chart is rendered as SVG using React, with d3.csv loading the United Nations World Population Prospects 2019 dataset and d3.scaleBand and d3.scaleLinear mapping country names and population values to positions and bar widths. React’s useState and useEffect manage the asynchronous data loading and state updates, while the bars themselves are drawn as SVG `<rect>` elements.

AI-generated description

Making a simple bar chart using data from United Nations World Population Prospects 2019 Dataset.

MIT Licensed

Similar vizzes