Skip to main content
100%

Bar charts

✓ Published1🌍 Public
Ddankvader1
Last edited Jul 4, 2022
Created on Jul 3, 2022
Forked from Customizing Axes

This example displays a horizontal bar chart of country populations, sorted by the data’s original order, with steelblue bars and a formatted x-axis. The visualization uses D3 v5’s `scaleLinear` and `scaleBand` to map population values and country names, with `axisLeft` and `axisBottom` generating the axes. Population values are parsed from a CSV file and multiplied by 1,000, while tick labels are shortened using `format('.3s')`. The SVG rendering includes custom margins, a title, and an axis label styled via external CSS.

AI-generated description
MIT Licensed

Similar vizzes