Skip to main content
Public

Share visualization

Loading preview…

Activity 6_Question 2

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

Activity 6_Question 2

0
BBharath Vupputuri
Last edited Apr 4, 2025
Created on Apr 4, 2025

This example visualizes the distribution of product sales across five regions as a stacked horizontal bar chart, using data from a CSV file with product rows and regional percentage columns. D3.js v7 with SVG rendering builds the chart, where each bar segment’s length encodes the percentage value per region, and tooltips reveal precise sales figures on hover. The code leverages `d3.csv` for data loading, `d3.stack` for computing the stacked layout, and `d3.scaleOrdinal` to assign colors to regions, with axes and legends generated via D3’s scaling and axis APIs.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed