Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity 6 task2

Public visualization

Activity 6 task2

0 stars0🌍 Public
Ssahithitoomu@gmail.com
Last edited Mar 30, 2025
Created on Mar 30, 2025

This stacked bar chart shows the racial composition of ten U.S. states, with each horizontal bar segmented into Asian, Black, and White population percentages. The visualization uses D3 v7’s stacking API (`d3.stack`) to layer the three categories, with a linear x-scale for percentages and a band scale for states. Hovering or clicking a segment reveals its exact percentage via an interactive tooltip, while inline labels display each segment’s value. The SVG rendering includes axes formatted as percentages, and the color scale assigns distinct hues to each racial group. The data is hardcoded as an array of state objects.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed