Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Question2

Public visualization

Viewing a saved revision (read-only)

1b23f91e7ec345a7aaf1710d9bfc77e5

Question2

0 stars1🌍 Public
Gganesh.hns48@gmail.com
Last edited Apr 4, 2024
Created on Apr 4, 2024
Forked from Hello VizHub

A stacked bar chart displays quarterly sales by product category, with categories on the y-axis and sales totals on the x-axis. The visualization uses D3 v7's `d3.stack`, `scaleBand`, `scaleLinear`, and `scaleOrdinal` APIs to construct the chart, with tooltips revealing the category and sales amount per segment. Data from the CSV file is loaded and rendered as SVG rectangles, with an interactive legend and axis labels. The code leverages D3's declarative `.join` pattern for efficient element updates.

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.