🌍 Public
Viewing a saved revision (read-only)
b01e898970aa427eb198c659bdf4bf11
assign-2
This example shows a pie chart displaying fruit quantities from a CSV dataset, using the D3.js v7 library and SVG rendering. The visualization computes slice geometries with `d3.pie()` and draws them with `d3.arc()`, while color assignments come from `d3.scaleOrdinal` with `schemeCategory10`. A legend, also built in SVG, maps each fruit name to its corresponding color using small rectangles and text labels positioned relative to the chart’s center. The code loads data asynchronously via `d3.csv`, and the chart is centered within a 400×400 pixel viewport.
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.