A bar chart that adds data with mouse-click
✓ Published2🌍 Public
Nnikomc
Last edited Apr 3, 2020
Created on Apr 1, 2020
Clicking the text updates a bar chart with a new random dataset. The bars and their value labels smoothly transition to reflect the new data, with the y-scale dynamically adjusting to the maximum value. The chart is rendered as an SVG using D3 v5, and the update is driven by a `d3.select("p").on("click")` handler, using `transition().delay()` and `ease(d3.easeCubicInOut)` for animation. The y-axis uses a linear scale while the x-axis uses a band scale.
AI-generated descriptionLearning about scales with D3 (from Scott Murray's book).
MIT Licensed