Skip to main content
Public

Share visualization

Loading preview…

Stacked Bar Chart with HTML and movable filter

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Stacked Bar Chart with HTML and movable filter

1
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

Comments

Sign in to join the discussion.

MIT Licensed