Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Untitled

Public visualization

Viewing a saved revision (read-only)

49ae8f52b79a4482ae4cd1d11d9456f6

Untitled

0 stars0🌍 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.