Activity-6-Question2-1
✓ Published0🌍 Public
This example visualizes the distribution of sales across electronics categories using a stacked horizontal bar chart with D3.v7. It shows proportions of sales for five ranges, from "less than 5" to "greater than 8.5," across six product categories. The chart uses `d3.stack()` to create stacked segments, `d3.scaleBand` for categories, and `d3.axisLeft`/`d3.axisBottom` for axes. The code attaches a tooltip via `d3.select` to display exact sales values on mouseover. Data is loaded from a CSV file containing category and sales-range percentages.
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