Skip to main content
100%

Animated Chart

✓ Published0🌍 Public
ZZac02
Last edited Mar 3, 2023
Created on Mar 3, 2023
Forked from Basic Bar Chart

A React component renders an SVG bar chart of annual values, with three bars for the years 2020 through 2022. A button click swaps the dataset, triggering a smooth transition where the bars animate their height and vertical position over one second using d3’s `transition`. The chart uses `d3.scaleBand`, `d3.scaleLinear`, `d3.axisBottom`, `d3.axisLeft`, and `d3.selectAll` to build and update the visualization within a `useEffect` hook on data changes.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes