Skip to main content
100%

Making a bar chart with D3.js

✓ Published0🌍 Public
LLionelbarbagallo
Last edited Jul 15, 2020
Created on Jul 15, 2020

This example shows a horizontal bar chart of population per country, using data from WorldoMeter. The chart ranks countries from China to Japan by population, with each bar’s length scaled linearly. Built with D3 v5 and React, it renders SVG elements via `select`, `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`. Margins are applied to the SVG, and the bars are appended as `rect` elements with a steelblue fill.

AI-generated description

A bare minimum HTML page.

See also React Starter.

Bar chart of population per country taken from the WorldoMeter.

MIT Licensed

Similar vizzes