Skip to main content
100%

Stacked Bar Chart

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

This stacked bar chart displays population data for cities, grouped by state and country. It uses D3.js v6 to process the nested dataset with `d3.nest()` and `d3.stack()`, then renders the stacks as SVG rectangles with an ordinal color scale. The chart includes axes via `d3.axisBottom()` and a legend. The data is hardcoded in the script rather than loaded from an external source.

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