Skip to main content
100%

Activity-6 (question2.1)

✓ Published0🌍 Public
Kkandulasunny17@gmail.com
Last edited Oct 22, 2024
Created on Oct 22, 2024

This chart displays monthly sales figures for three product categories—Electronics, Clothing, and Home Goods—as a stacked horizontal bar chart. D3’s `scaleBand` positions months on the y-axis, while a `scaleLinear` maps cumulative sales values to x-axis lengths. Each bar segment’s width corresponds to category-specific revenue, with a legend and interactive tooltips revealing exact dollar amounts on hover. The example loads D3 v7 via UNPKG, reads CSV data asynchronously, and constructs the SVG visualization using `d3.axisLeft`, `d3.axisBottom`, `d3.stack`, and `scaleOrdinal` for color encoding.

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