Skip to main content
100%

Making a bar chart

✓ Published2🌍 Public
Cchrisdreece
Last edited Jan 14, 2021
Created on Jan 8, 2021
Forked from Make a Face

This example shows a horizontal bar chart comparing the populations of ten countries, sorted by the country name. It uses D3 v6 to load a CSV file and render SVG rectangles. The code defines linear and band scales with `scaleLinear` and `scaleBand`, and draws the y-axis using `axisLeft`. Rectangles are appended via the enter selection, with widths mapped to population values and heights set by the band's bandwidth.

AI-generated description
MIT Licensed

Similar vizzes