Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
MMounikaBeerelly
Last edited Jun 5, 2020
Created on Jun 5, 2020

This example displays the populations of the ten most populous countries in 2018, ordered along a vertical bar chart. It uses D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to map population values to horizontal bar widths and country names to vertical bands. The data, sourced from the United Nations’ 2017 World Population Prospects, is loaded via `csv` and rendered as SVG rectangles. The code explicitly multiplies population figures by 1,000 to reflect actual counts.

AI-generated description

This bar chart shows population of the top 10 most popular countries. The data comes from the year 2018, estimate in United Nations: World population prospects 2017 .

MIT Licensed

Similar vizzes