Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
Nnilimi
Last edited Jan 15, 2020
Created on Jan 10, 2020

This example shows a horizontal bar chart of country populations using SVG rendering. The visualization maps population values to bar widths and country names to vertical bands, with axes labeled via `d3.axisLeft` and `d3.axisBottom`. The code loads data from a CSV file using `d3.csv`, scales the population figures, and appends rectangular elements with `d3.selectAll` and `.enter()`. The chart uses `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis, with the bars styled in steel blue via CSS.

AI-generated description

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

MIT Licensed

Similar vizzes