Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Act6_q2

Public visualization

Viewing a saved revision (read-only)

2f49f20ee3284339bf1a582c7de8b83d

Act6_q2

0 stars0🌍 Public
Pp99vijaya@gmail.com
Last edited Oct 25, 2024
Created on Oct 25, 2024

This example shows a stacked bar chart of three region values across four years, with each bar segment colored by region and labeled with year and value axes. The chart is rendered as SVG using D3 v7, leveraging `d3.stack()` to compute the layered series, `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and `d3.schemeSet2` for categorical colors. The data is embedded directly in the script rather than loaded from the CSV file, and axes are added via `d3.axisBottom` and `d3.axisLeft`.

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.