Skip to main content
100%

Activity-6 Question-3

✓ Published0🌍 Public
KKavyaEti
Last edited Oct 25, 2024
Created on Oct 25, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes