Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
Ttrungngonptit
Last edited May 25, 2020
Created on May 25, 2020
Forked from HTML Starter

This example shows a horizontal bar chart of the populations of ten countries, using data from a CSV file. The chart renders as SVG, with country names on the y-axis and population totals on the x-axis, scaled linearly. The code uses D3 v5 methods like `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load data, compute scales, and draw axes, while appending rectangles for each bar. Population values are multiplied by 1000 after parsing.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes