Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

b8fc5d88e5f04fe3b0d0c4b0a7fd2f7a

Making a bar chart

0 stars0🌍 Public
MMaciek Sitkowski
Last edited Aug 27, 2020
Created on Aug 27, 2020

This example shows a horizontal bar chart of the populations of the world’s most populous countries, using data from a CSV file. It demonstrates fundamental D3.js DOM manipulation by loading the data, setting up linear and band scales, and appending SVG rectangles for each bar. The code uses `d3.select`, `d3.csv`, `scaleLinear`, `scaleBand`, and the `axisLeft` and `axisBottom` components to render the chart.

AI-generated description

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