Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Stacked Bar Chart

Public visualization

Viewing a saved revision (read-only)

665bfb16a50e45faa65102f88f8b948d

Stacked Bar Chart

0 stars0🌍 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.