Skip to main content
100%

Making a Bar Chark

✓ Published0🌍 Public
Yyingzhe-z
Last edited Mar 15, 2021
Created on Mar 15, 2021
Forked from HTML Starter

This example shows a horizontal bar chart of country populations using D3.js v5. The SVG canvas displays bars whose lengths correspond to each nation’s population value from a CSV file, with country names listed along the vertical axis. The code uses `d3.csv`, `d3.scalelinear`, `d3.scaleBand`, and `d3.max` to map data to coordinates, appending `rect` elements to the SVG. Populations are parsed as numbers before rendering, and the chart loads asynchronously via the `csv` function.

AI-generated description
MIT Licensed

Similar vizzes