Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars1🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed