Skip to main content
100%

Fork of Making a bar chart in D3.js

✓ Published0🌍 Public
GGabe Nascimento
Last edited Oct 14, 2021
Created on Oct 14, 2021

This example shows the population of the top 10 most populous countries, based on 2018 estimates from the UN World Population Prospects. A light blue SVG canvas renders horizontal bars, with country names on the left axis and population values on the bottom axis. The code uses d3.csv to load the data, d3.scaleLinear for the x-axis, d3.scaleBand for the y-axis, and d3.axisLeft and d3.axisBottom for tick labels. Bars are appended as SVG rect elements with steelblue fill via d3 selection and data joins.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in World Population Propsects 2017.

MIT Licensed

Similar vizzes