Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

19ccb07efb8c41a8b1503392f584ad4a

Making a bar chart

0 stars2🌍 Public
AAlex Reitz
Last edited Mar 25, 2020
Created on Mar 23, 2020
Forked from HTML Starter

This example shows a horizontal bar chart ranking the populations of the ten most populous countries, using data from a CSV file where values are multiplied by 1000. The visualization uses D3 v5’s `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` APIs to map population to bar widths and country names to y-axis positions, rendering the bars as SVG rectangles. Axes are appended via `call`, and the chart is drawn within a fixed 960x500 SVG canvas with margins.

AI-generated description