Skip to main content
Public

Share visualization

Loading preview…

Clickable Stacked Bar Chart with HTML

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

Clickable Stacked Bar Chart with HTML

1
BBismark Kofi Owusu Sarfo
Last edited Oct 1, 2025
Created on Oct 1, 2025

This stacked bar chart shows BMW sales volumes by year, broken down by region, with each segment colored according to its region. The visualization is built using D3 v7 with SVG rendering, and it also includes a clickable legend. Clicking a legend item or a bar segment toggles the highlight for that region, turning the selected elements white. The chart loads data from a CSV file and aggregates sales volumes using `d3.rollups` and `d3.sum`, with axes and grid lines configured via `d3.axisBottom` and `d3.axisLeft`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed