🌍 Public
Viewing a saved revision (read-only)
aa4cfafdb262486a966b87ea6c457473
A6_Q2
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.