Making a bar chart with D3.js
✓ Published0🌍 Public
This example shows a horizontal bar chart of country populations using D3.js v5, with data loaded from a CSV file and rendered as SVG rectangles. The chart uses `d3.scaleLinear` for the x-axis population scale and `d3.scaleBand` for the categorical y-axis, with `d3.axisLeft` and `d3.axisBottom` to draw the axes. Population values are formatted by multiplying the raw CSV numbers by 1000, and the bars are styled with a steelblue fill.
AI-generated descriptionMIT Licensed