Skip to main content
100%

Activity6_Question2

✓ Published0🌍 Public
Vvarshithainaganti@gmail.com
Last edited Oct 22, 2024
Created on Oct 22, 2024
Forked from Hello VizHub

This example visualizes mobile phone sales data from a CSV file as a horizontal stacked bar chart, displaying yearly sales figures for Apple, Samsung, Motorola, and Google. The chart uses D3.js v7 to load data, apply sequential color scales, and render the SVG with axis labels and a tooltip that reveals specific sales values on hover. The code demonstrates importing D3 via UNPKG, using utility functions like `d3.stack()` and `d3.scaleBand()`, and structuring chart elements with an SVG canvas.

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