Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Activity6_task 2- Q1

Public visualization

Viewing a saved revision (read-only)

da7486d46d98431482cdf9906d417efc

Fork of Activity6_task 2- Q1

0 stars0🌍 Public
PPreethamreddyannavaram@my.unt.edu
Last edited Apr 4, 2025
Created on Apr 4, 2025
Forked from Activity6_Questn2

This example shows smartphone usage percentages across five age groups as a horizontal stacked bar chart, with four activity categories (Social Media, Gaming, Productivity, Communication) distinguished by color. The visualization uses d3.stack() to compute layered series from CSV data, then binds rectangles to each layer using data joins. A d3.scaleBand positions age groups on the y-axis, while a d3.scaleLinear maps percentages to x-axis positions. The chart includes axes with percentage tick formatting and a custom SVG legend built from the same ordinal color scale, rendered entirely as SVG elements.

AI-generated description