Skip to main content
100%

Making a Bar Chart

✓ Published3🌍 Public
AAznaggar
Last edited Jan 8, 2020
Created on Jan 7, 2020
Forked from HTML Starter

This example shows a horizontal bar chart of population by country, ordered from most to least populous, with each bar’s length encoding the population value. The visualization uses d3.csv to load data from a CSV file, d3.scaleLinear for the x-axis, d3.scaleBand for the y-axis, and d3.axisLeft and d3.axisBottom for the axes. Bars are rendered as SVG rectangles, with a fixed margin and responsive inner chart area computed from the SVG’s width and height attributes. The code uses d3.v5 and is structured as a React-compatible plain JavaScript module.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes