Skip to main content
100%

Making a bar chart

✓ Published2🌍 Public
Mmla341
Last edited Jun 21, 2020
Created on Jun 20, 2020

This example shows a horizontal bar chart of country populations, with bars sorted by population and labeled on the y-axis. It uses D3 v5 methods such as `scaleBand` for the categorical axis, `scaleLinear` for the numeric population scale, and the `axisLeft` and `axisBottom` functions to generate the axes. The chart is rendered as SVG, with each bar’s height set by `yScale.bandwidth()` and its width proportional to population, as read from a CSV file and scaled by a factor of 1,000.

AI-generated description
MIT Licensed

Similar vizzes