Skip to main content
100%

Making a barchart

✓ Published1🌍 Public
MMartin Casey
Last edited Feb 22, 2021
Created on Feb 20, 2021

This example builds a horizontal bar chart comparing the populations of the ten most populous countries, using data loaded from a CSV file. The page renders SVG bars and axes with D3.js, employing `d3.scaleLinear` for the population values, `d3.scaleBand` for country categories, and the `axisLeft` and `axisBottom` components for tick marks. The chart uses a fixed SVG canvas of 960 by 500 pixels, with margins defined around the plotting area.

AI-generated description

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

MIT Licensed

Similar vizzes