Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

A6_Q2

Public visualization

Viewing a saved revision (read-only)

962e35aaa8f6444ebfef3a664e31d197

A6_Q2

0 stars0🌍 Public
SShashankkodishala@my.unt.edu
Last edited Oct 20, 2024
Created on Oct 20, 2024
Forked from Hello VizHub

A stacked bar chart visualizes smartphone market share across five price ranges—Low, Mid, High, Premium, and Ultra Premium—for six brands. Each horizontal bar represents a brand, with colored segments depicting the proportional share in each price tier. The code uses D3.js v7, building an SVG with `d3.select`, `d3.scaleBand`, and `d3.scaleLinear` for axes, and `d3.stack` to aggregate the data. Color mapping is handled via `d3.scaleOrdinal`, and a legend is manually constructed using `svg.append`. The synthetic dataset defines share values for each brand and price range.

AI-generated description