Fork of Hello VizHub
✓ Published1🌍 Public
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 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