Skip to main content
100%

Making a bar chart

✓ Published2🌍 Public
WWhitney Hung
Last edited May 26, 2020
Created on May 22, 2020

This example shows a horizontal bar chart of population figures for the world’s most populous countries, using a CSV dataset where values are multiplied by 1,000. The chart uses an SVG container and D3 v5’s `scaleLinear` for the population axis, `scaleBand` for the country categories, and `axisLeft`/`axisBottom` to render tick marks. Rectangles are appended via a data join, with width mapped to population and height set to the band’s bandwidth.

AI-generated description
MIT Licensed

Similar vizzes