🌍 Public
Viewing a saved revision (read-only)
f693276f4ae24cb7808232e7a8c3fbea
Assignment 2 Question 1
This example shows the distribution of fruit categories using a pie chart, with each slice sized according to the value in the "4-5" column from a remote CSV file. The visualization renders as an SVG using D3 v7, with colored slices, a bold title, and an interactive legend that displays category names. D3's `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` APIs generate the chart and color scheme, while the legend uses `rect` and `text` elements to map colors to categories. The data is fetched via `d3.csv` from a GitHub gist, and labels for "Category" and "Percentage" are added as static text elements.
AI-generated description