Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

a813993c13224f07b9f1a7065b624f5a

Making a Bar Chart

0 stars0🌍 Public
Vvitachan
Last edited Jan 28, 2022
Created on Jan 28, 2022

This example demonstrates how to build a bar chart from a CSV file of country populations using D3.js. The visualization maps each country to a rectangle, with bar heights proportional to population values, rendered as SVG elements. The code uses D3's `select` and `csv` functions, importing data from `data.csv` and logging it to the console. The chart is created within an SVG canvas sized 960 by 500 pixels, with the styling handled by an external stylesheet.

AI-generated description

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