Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity_6_Question 2.3

Public visualization

Viewing a saved revision (read-only)

a186c1dfa896434f82fac574262e0fbf

Activity_6_Question 2.3

0 stars0🌍 Public
Kkesava
Last edited Oct 25, 2024
Created on Oct 25, 2024
Forked from Hello VizHub

A stacked bar chart displays regional product sales, with each bar segmented by product category (productA, productB, productC) and colored via a categorical scale. The visualization loads CSV data with d3.csv and d3.autoType, then uses d3.stack to compute the stacked series. d3.scaleBand maps regions to x positions, d3.scaleLinear maps sales values to y positions, and d3.axisBottom and d3.axisLeft render the axes. A legend groups color swatches and labels, while the SVG output is generated entirely in d3.v7.

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.