Skip to main content
100%

Activity-9_Question-1

✓ Published0🌍 Public
Ttharunramula@gmail.com
Last edited Apr 22, 2024
Created on Apr 21, 2024
Forked from Hello VizHub

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 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