Making a barchart
✓ Published0🌍 Public
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 descriptionMIT Licensed