Skip to main content
100%

D3.js: Animating Stacked-to-Grouped Bars

✓ Published0🌍 Public
EEfratVil
Last edited Jan 20, 2016
Created on May 5, 2016

This example demonstrates an interactive bar chart that smoothly transitions between stacked and grouped layouts, with a single click on the chart toggling between the two modes. It uses D3.js v3 to render the chart as an SVG, animating the bars' positions and sizes via `transition` and custom attribute tweens. The data is generated in-browser with a `bumpLayer` function, and hovering a bar shows a tooltip listing the three series values using Underscore.js templates and jQuery for DOM manipulation. A legend with clickable series boxes lets viewers enable or disable individual series, updating the chart and the number of enabled series accordingly.

AI-generated description

Similar vizzes