Skip to main content
100%

Mobile Inventory stacked bar chart

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

This example shows mobile inventory counts for three brands—Samsung, OnePlus, and Motorola—broken into Mobile, Tablet, and Earpods categories using a stacked bar chart. Each bar segments three colored rectangles (pink, yellow, red) representing the product types, with axis labels and a legend to the right. The code uses D3 v7 via UNPKG, building the visualization with `d3.scaleBand`, `d3.scaleLinear`, and `d3.axisBottom`/`d3.axisLeft` in an SVG. The dataset is hardcoded in the script, and the legend maps each color to its corresponding value name.

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