Skip to main content
100%

Stacked Bar Chart with HTML and movable filter

✓ Published1🌍 Public
BBismark Kofi Owusu Sarfo
Last edited Nov 22, 2025
Created on Nov 22, 2025

This example shows a stacked bar chart of BMW model sales by year, where each bar segment represents a model's sales volume. A movable filter panel lets the user highlight the model with the highest or lowest total sales, dimming all other segments for comparison. Built with D3 v7, it uses `d3.rollups` to aggregate the CSV data by year and model, `d3.stack` for stacking, `d3.scaleBand` and `d3.scaleLinear` for axes, and SVG rendering for interactive bars with tooltips.

AI-generated description
MIT Licensed

Similar vizzes