🌍 Public
Viewing a saved revision (read-only)
2cae8ac4556b437c9882d00bf6d1cb7b
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