Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

a87ba80850534b8bbdbe510c690f16a9

Making a Bar Chart

0 stars0🌍 Public
CCharlotte1891
Last edited Aug 13, 2020
Created on Aug 13, 2020
Forked from Making a Bar Chart

This example displays a bar chart of the top 10 most populous countries, using 2018 population estimates from the United Nations World Population Prospects. The population values, stored in a CSV file, are multiplied by 1,000 and mapped to bar widths using `d3.scaleLinear`, while country names are positioned on a `d3.scaleBand` axis. It uses `d3.axisLeft` and `d3.axisBottom` to render axes, with tick labels formatted via `d3.format`. The chart is drawn as SVG elements, with a title and axis label added as text.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.