Skip to main content
100%

Stacked Bar Chart

✓ Published0🌍 Public
VVenkat-Sumith-Thota
Last edited Jul 17, 2023
Created on Jul 17, 2023
Forked from Hello VizHub

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 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