Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
Ffarmanali0303
Last edited Jul 26, 2020
Created on Jul 26, 2020
Forked from Making a Bar Chart

This example displays the top 10 most populous countries from 2018 United Nations estimates as a horizontal bar chart. It customizes both axes, removing the y-axis domain and tick lines and formatting x-axis labels with d3.format to abbreviate population values, replacing “G” with “B” for billions. The chart uses d3.scaleLinear and d3.scaleBand to map populations and country names, with data loaded from a CSV file via d3.csv. The SVG is rendered using D3 v5, with steelblue bars and a titled, labeled layout.

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.

MIT Licensed

Similar vizzes