Skip to main content
100%

Making a bar chart

✓ Published2🌍 Public
Mmagua
Last edited Oct 2, 2020
Created on Oct 2, 2020

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 description
MIT Licensed

Similar vizzes