Skip to main content
100%

Making a barchart

✓ Published0🌍 Public
LLun
Last edited Mar 14, 2021
Created on Mar 9, 2021
Forked from React Starter

This example shows a horizontal bar chart of population figures for nine countries, drawn as an SVG. The chart maps population values to bar widths using D3’s `scaleLinear` and countries to vertical bands with `scaleBand`, then renders the bars as `rect` elements. Data is loaded from a CSV file with `d3.csv`, with population values multiplied by 1000, and axes are omitted, focusing solely on the bar geometries. The bars are styled with a steelblue fill via CSS, and the SVG is sized at 960 by 500 pixels.

AI-generated description
MIT Licensed

Similar vizzes