Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

7ed3b7ff83384b779678e6677cc4d8e3

Making a Bar Chart

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