🌍 Public
A4 Barchart D3
This bar chart tracks the percentage of total smokers in the United States from 1980 to 2012, revealing a steady decline over three decades. The visualization uses an SVG canvas rendered with D3.js v7, where bars are drawn using SVG `rect` elements scaled by a band scale on the x-axis and a linear scale on the y-axis. Data is loaded from a CSV file via `d3.csv` and axes are generated with `d3.axisBottom` and `d3.axisLeft`. Hovering changes bar color to orange, and tooltips show the exact percentage per year.
AI-generated descriptionReference: https://d3-graph-gallery.com/graph/barplot_basic.html
Also used chatgpt to implement certain features
MIT Licensed
Comments
Sign in to join the discussion.