Skip to main content
100%

Making a Barchart

✓ Published1🌍 Public
CCarloGato
Last edited Dec 3, 2019
Created on Dec 2, 2019

This example shows the population of the world’s most populous countries as horizontal bars, sorted by country name. Using D3 v5, it loads a CSV dataset and renders an SVG bar chart with linear and band scales. The code imports specific D3 modules—`select`, `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`—to create axes and position rectangles. Population values are converted from thousands to absolute numbers before being mapped to bar widths.

AI-generated description
MIT Licensed

Similar vizzes