Fork of Activity6_task 2- Q1
✓ Published0🌍 Public
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 descriptionMIT Licensed