Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

61857051a7b94de4b7c71e82d889ab6d

Making a bar chart

0 stars2🌍 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