Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

A6 Barchart D3

Public visualization

Viewing a saved revision (read-only)

2cae8ac4556b437c9882d00bf6d1cb7b

A6 Barchart D3

0 stars0🌍 Public
EEric Yao
Last edited Mar 20, 2024
Created on Mar 4, 2024
Forked from A4 Barchart D3

This example visualizes the percentage of smokers in the United States from 1980 to 2012 using a vertical bar chart. Each bar’s height and color encode the recorded percentage value, with a sequential blue color scale mapped via `d3.scaleSequential` and `d3.interpolateBlues`. The chart includes axes, labels, a title, and a legend generated with the `d3-legend` library’s `d3.legendColor`. Data is loaded from a CSV file and rendered as SVG using D3 v7, with tooltips provided by appended `<title>` elements.

AI-generated description