Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed