🌍 Public
Viewing a saved revision (read-only)
fe9d0dd2961f4b00a2b3f2e4bd4df5fe
A6 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 descriptionReference: https://d3-legend.susielu.com/#color