Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
GGeolffrey S Mena
Last edited Aug 7, 2019
Created on Aug 7, 2019
Forked from Making a Bar Chart

This example shows a bar chart of the top 10 most populous countries, using 2019 estimates from the World Population Prospects dataset. The chart encodes population on a linear scale and country names on a band scale, with axes and tick labels rendered in SVG. The code uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand for scales, and d3.axisLeft and d3.axisBottom for axes. It also formats tick labels using d3.format, replacing “G” with “B” to display values in billions. The chart is styled with custom CSS and a title.

AI-generated description

This is a bar chart shows population of the top 10 most populous countries. The data comes from the year 2019 estimates in World Population Prospects 2019

MIT Licensed

Similar vizzes