Making a bar chart
✓ Published2🌍 Public
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 descriptionMIT Licensed