Skip to main content
100%

Making a bar chart

✓ Published2🌍 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
MIT Licensed

Similar vizzes