Skip to main content
100%

Making a Bar Chart

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

This example uses D3 v5 to render a horizontal bar chart of the top 10 most populous countries, with population values from the 2017 United Nations World Population Prospects (2018 estimates). It employs `scaleLinear` and `scaleBand` for positioning and sizing, and customizes the axes via `axisBottom` with a tick formatter that converts large numbers to billions. The chart’s bars are drawn as SVG rectangles, with axis labels and a title added as text elements.

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