Skip to main content
100%

Fork of Hello VizHub

✓ Published1🌍 Public
KKritin Kesav
Last edited Apr 20, 2024
Created on Apr 20, 2024
Forked from Hello VizHub

This example shows a pie chart with a legend, displaying the quantities of four fruits. It loads D3 via UNPKG and uses local ES6 module imports. The visualization uses `d3.pie` and `d3.arc` to generate and render the slices, with `d3.scaleOrdinal` for categorical colors. It appends an SVG to the body, positions the pie in the center, and adds text labels using the arc centroid. A separate legend group is built with rectangles and text, anchored to the right side of the SVG.

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