Making a bar chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of country populations using a bar for each nation, drawn as SVG rectangles scaled by population value. The code loads data from a CSV file and uses D3 v6 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to construct the scales and axes. Bars are appended via a data join, with population values parsed and multiplied by 1000, and the chart is rendered with margins and a steelblue fill.
AI-generated descriptionMIT Licensed