Making a bar chart
✓ Published2🌍 Public
This example shows a horizontal bar chart of population estimates for ten countries, using a CSV data file. The bars are rendered as SVG rectangles with a steelblue fill, and the chart includes left and bottom axes. The code uses D3 v5’s `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load data, map population values to widths, and position country labels. Population numbers are read as strings and converted to numeric values before scaling.
AI-generated descriptionMIT Licensed