Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
YYunLing
Last edited Sep 15, 2023
Created on Sep 14, 2023

This example displays a horizontal bar chart of the ten most populous countries, using population data from a CSV file. D3 v5 scales are used to map countries to y-axis bands and population values to bar widths, with axes formatted to abbreviate large numbers. The chart is rendered as SVG, with gridlines and labels styled via CSS. The code imports specific functions from the d3 library, including `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, `csv`, and `max`.

AI-generated description
MIT Licensed

Similar vizzes