Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

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

Comments

Sign in to join the discussion.

MIT Licensed