Skip to main content
100%

Activity 6_Question 2

✓ Published0🌍 Public
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
MIT Licensed

Similar vizzes