Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

making bar chart

Public visualization

Viewing a saved revision (read-only)

f71ed200cc0c461f813c9aee0efa90b5

making bar chart

1 star1🌍 Public
Ttayyabanisar
Last edited May 14, 2020
Created on May 14, 2020
Forked from HTML Starter

This example shows a horizontal bar chart of country populations using D3.js v5. Rectangles are appended to an SVG canvas, with each bar’s width mapped from population values (converted from strings to numbers and scaled by 1000) via `d3.scaleLinear` and a domain from 0 to the maximum population. The chart loads CSV data with `d3.csv` and uses `d3.max` to determine the scale domain. Bars are fixed at a height of 400 pixels, causing overlap, as the y-scale code is commented out.

AI-generated description