Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

3c7607886ced4d4db459d37f3ad4d386

Making a Bar Chart

0 stars0🌍 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.