Skip to main content
100%

Stacked Bar Chart

✓ Published1🌍 Public
UUVarshaReddy
Last edited Jul 21, 2023
Created on Jul 20, 2023
Forked from Hello VizHub

This stacked bar chart displays the distribution of product categories—Formal, Casual, and Shoes—across four clothing brands. Each brand’s total value is segmented into three colored bars, with a legend identifying each category. The chart uses D3 v7’s `scaleBand` for the x-axis, `scaleLinear` for the y-axis, and `selectAll` to render the grouped rectangles as SVG. The dataset is hardcoded, and colors are assigned via an array of hex codes.

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