Skip to main content
100%

Activity7_Piechart

✓ Published0🌍 Public
Llikhitha.sarahah01@gmail.com
Last edited Nov 1, 2024
Created on Nov 1, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes