Stacked Bar Chart
✓ Published0🌍 Public
This stacked bar chart compares four clothing brands across three product categories—Formal, Casual, and Shoes—using a fixed dataset embedded in the script. The chart renders in SVG via D3 v7, with `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and `d3.axisBottom`/`d3.axisLeft` for tick marks. Each brand’s stacked segments are colored distinctly, with a manual legend built from appended rectangles and text. The code loads D3 from UNPKG and uses inline JavaScript without local modules.
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