Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a barchart

Public visualization

Viewing a saved revision (read-only)

dfdbe768184441d09a042bf4e408a55e

Making a barchart

0 stars1🌍 Public
RRiccardo Pressiani
Last edited Oct 1, 2019
Created on Oct 1, 2019

This example shows a horizontal bar chart ranking the ten most populous countries, with population values read from a CSV file and displayed on a linear scale while country names appear on a band scale. It demonstrates fundamental D3.js DOM manipulation by selecting the SVG, appending a group for margins, and binding data to rectangle elements. The code uses `d3.csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to render the chart with steel-blue bars and labeled axes.

AI-generated description

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