Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Barchart

Public visualization

Viewing a saved revision (read-only)

23430227484b4d27a33ea4ba8ca41643

Making a Barchart

0 stars1🌍 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