Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

a81853923c2a4bb7aa3ef9a8b1abe361

Making a bar chart

0 stars0🌍 Public
Bbilibili
Last edited Jun 10, 2020
Created on Jun 10, 2020

This example demonstrates the fundamental steps of creating a bar chart with D3.js, starting with selecting an SVG element and loading data from a CSV file. The code uses `d3.select` to grab the SVG and `d3.csv` to asynchronously fetch `data.csv`, logging the parsed data to the console. It sets the chart’s dimensions by reading the SVG’s width and height attributes. While the current implementation only loads and logs the data, it establishes the scaffolding for binding that data to visual bars, relying on D3 v5’s data-join and SVG rendering capabilities.

AI-generated description

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