Making a Bar Chart
✓ Published0🌍 Public
This example shows a horizontal bar chart of country populations from a CSV file, with bars sized using d3.scaleLinear and positioned with d3.scaleBand. The SVG rendering is driven by d3.csv loading and parsing the data, converting population strings to numbers, then appending rectangles. The code relies on D3 v5’s select, csv, scaleLinear, max, and scaleBand APIs to build the chart without axes or labels, as the stylesheet defines no text elements.
AI-generated descriptionMIT Licensed