Skip to main content
100%

assign-2

✓ Published0🌍 Public
Vvaishnavi6gan@gmail.com
Last edited Apr 11, 2024
Created on Apr 11, 2024
Forked from Activity-6

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 description
MIT Licensed

Similar vizzes