Skip to main content
100%

Making a bar chart

✓ Published1🌍 Public
JJaKokosz
Last edited Mar 24, 2020
Created on Mar 24, 2020

This example shows a horizontal bar chart ranking ten countries by population, with countries on the y-axis and population values on the x-axis. The code uses D3 v5’s `csv` to load the data, `scaleLinear` and `scaleBand` for scaling, and `axisLeft` and `axisBottom` to render axes. Bars are drawn as SVG `rect` elements, with a steelblue fill, and the chart is fitted within margins inside an SVG canvas.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes