task2
✓ Published0🌍 Public
This example presents a stacked bar chart that visualizes the distribution of three product categories (Product A, Product B, and Product C) across four geographic regions: North, South, East, and West. The chart uses SVG rendering to display the bars, with each product assigned a distinct color from the `d3.scaleOrdinal` and `d3.schemeCategory10` color scale. The code utilizes `d3.stack()` with `d3.stackOrderNone` and `d3.stackOffsetNone` to compute the stacked segments from the hardcoded data. A legend is appended to identify each product category, and the chart dimensions are fixed at 600 by 400 pixels.
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