Activity-9_Question-1
✓ Published0🌍 Public
This example shows a pie chart displaying vegetable quantities in kilograms. D3.js v7 is used to load the data and generate the SVG rendering, with `d3.pie()` calculating the slice angles and `d3.arc()` drawing the paths. A categorical color scale from `d3.schemeCategory10` fills each slice, and a legend listing the five vegetables appears alongside the chart. Axes labels for "Vegetables" and "Quantity (kg)" frame the visualization, while the sample dataset is hardcoded in the script.
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