Skip to main content
100%

Let's make a bar chart!

✓ Published0🌍 Public
CChromosin13
Last edited Nov 5, 2021
Created on Nov 4, 2021

A horizontal bar chart displays population figures for ten countries, using bar length to represent population in thousands. Built with D3 v5, the visualization loads CSV data via `d3.csv` and applies `d3.scaleLinear` for the x-axis and `d3.scaleBand` for categorical y-axis spacing. SVG rectangles are appended and positioned through D3 data joins, with margins calculated from the SVG's width and height attributes. The code demonstrates fundamental scale and selection patterns for basic bar chart construction.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes