Stacked Bar Chart
✓ Published0🌍 Public
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 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