Skip to main content
100%

Untitled

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

An interactive bar chart displays the growth rate change in U.S. energy sources from 2012 to 2021, with buttons to toggle between Solar and Gas datasets. The visualization shows outlined, red-stroked bars in an SVG, where each bar’s height represents the annual emission growth value. Using D3 v4, the code implements `d3.scaleBand()` for the x-axis, `d3.scaleLinear()` for the y-axis, and transitions that animate axis updates over 2.5 seconds. A tooltip appears on mouseover, and the chart title and axis labels update dynamically based on the selected energy source.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes