Activity-6 Question-3
✓ Published0🌍 Public
This visualization shows device sales across smartphone, laptop, and tablet categories for five brands using a horizontal stacked bar chart rendered as SVG. The chart uses d3.stack() to compute stacked segments, d3.scaleLinear() for the sales axis, and d3.scaleBand() for brand categories. Hover interactions trigger opacity changes and tooltips displaying exact sales values via a div element. Data comes from an embedded devices_sales.csv file with sales figures for Samsung, Lenovo, Nokia, Apple, and Google Pixel.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed