Skip to main content
100%

Stacked Bar Chart

✓ Published0🌍 Public
Ssaipaidipalli
Last edited Jul 22, 2023
Created on Jun 28, 2023
Forked from Hello VizHub

This stacked bar chart displays three categories (category1, category2, category3) across three groups: Economy, Business, and First Class. The visualization uses D3 v7 to render SVG rectangles, with each bar segment stacked vertically using the `scaleBand` and `scaleLinear` scales. The code defines the data in a JavaScript array and applies `d3.axisBottom` and `d3.axisLeft` to generate the x and y axes. Color-coded segments (blue, orange, green) represent each category, showing their proportional contributions to the total value per group.

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