Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
YYanxiangZhu
Last edited Mar 26, 2019
Created on Mar 26, 2019

This example shows a horizontal bar chart of the top 10 most populous countries, using 2018 population estimates from the United Nations World Population Prospects. The chart uses an SVG rendered with D3 v5, importing `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` from the `d3` module. Population values from the CSV are converted to numbers and multiplied by 1000 before being mapped to bar widths. The y-axis positions country names, while the x-axis scales population linearly, with steelblue bars and labeled axes.

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.

MIT Licensed

Similar vizzes