Activity7_Piechart
✓ Published0🌍 Public
This example shows the global smartphone market share distribution across brands using a pie chart, with each slice representing a brand’s percentage and a color-coded legend listing all brands alongside their values. The visualization loads D3 from UNPKG and uses `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to generate the SVG paths, while data comes from a hardcoded array of brand shares. The chart is rendered entirely with SVG elements, and the legend uses `d3.selectAll` to append rectangles and text labels for each brand.
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.
MIT Licensed