Skip to main content
100%

Document

✓ Published1🌍 Public
Xxiaojingwu138
Last edited Jul 31, 2023
Created on Jul 28, 2023
Forked from D3 Starter

This interactive line chart shows the annual growth in U.S. electricity generation from Solar and Gas sources from 2012 to 2021. Users click buttons to toggle between the two datasets, triggering a transition that updates the axes and line path. Built with D3 v4, it uses `d3.line`, `d3.axisBottom`, and `d3.axisLeft` with linear scales, plus SVG transitions and a tooltip for mouseover values. Data comes from the provided `data.csv`, with hardcoded arrays in `vis.js` for each energy source.

AI-generated description
MIT Licensed

Similar vizzes