Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
Aarun-subba
Last edited Aug 24, 2020
Created on Aug 21, 2020

This example displays the top 10 most populous countries as horizontal bars, with country names on the y-axis and population counts along the x-axis. The chart uses data from the United Nations World Population Prospects 2019, loaded from a CSV file. Constructed with D3 v5, the code uses `select`, `csv`, `scaleLinear`, `scaleBand`, `max`, `axisLeft`, and `axisBottom` to define scales and render SVG rectangles. The bar lengths encode each nation’s population, drawn in steel blue with an accompanying axis for reference.

AI-generated description

A program that shows the top 10 most populous countries as a bar chart.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes