Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's explore data joins with a bar char

Public visualization

Let's explore data joins with a bar char

0 stars1🌍 Public
BBrett Cunningham
Last edited Nov 16, 2019
Created on Nov 16, 2019

This example uses a bar chart to illustrate data joins in D3.js, showing population figures for nine countries from a CSV file. The bars are rendered as SVG rectangles, with their heights mapped through `scaleBand` and widths through `scaleLinear`. The code loads data with `d3.csv`, converts population values to numbers, and appends rects via `selectAll().data().enter()`, demonstrating the fundamental enter selection pattern. The chart itself displays the sorted country population distribution, with China and India leading by a wide margin.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed