Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a barchart

Public visualization

Viewing a saved revision (read-only)

1dfce2a503b94d70afb8075c6924e93a

Making a barchart

0 stars1🌍 Public
SShane Carey
Last edited Feb 26, 2019
Created on Aug 30, 2018
Forked from Face in d3

This example shows a horizontal bar chart comparing 2018 population figures across continents, with each bar labeled by continent name and formatted population value. The SVG visualization uses D3 v5 scales—`scaleLinear` for the x-axis population range and `scaleBand` for the y-axis continent categories—with padding to separate bars. Data is parsed from a CSV string in `data.js` using D3’s `csvParse`, and numeric values are cleaned of commas and percentage signs. Rects and text are bound to the data via `selectAll` and `.enter()`, with bar widths scaled against the maximum population.

AI-generated description