Skip to main content
100%

Making a bar chart

✓ Published1🌍 Public
Sstephanie0215
Last edited Sep 22, 2022
Created on Sep 22, 2022

This example shows a horizontal bar chart of population data for the ten most populous countries, drawn as SVG rectangles scaled by population and ordered by country name. It uses D3 v7’s `scaleLinear` for the x-axis, `scaleBand` for the y-axis categories, and `axisLeft` and `axisBottom` to render ticks. The chart loads data from `data.csv` via `d3.csv`, converts population values to numbers, and appends the rectangles with a fixed steelblue fill.

AI-generated description

T

MIT Licensed

Similar vizzes