Assignment 2 - Question 1
✓ Published0🌍 Public
This example shows a pie chart of food categories with quantities displayed both inside the slices and in a legend, using a color scale with four distinct sections. The visualization loads CSV data from a GitHub repository via `d3.csv`, then renders SVG arcs using `d3.pie` and `d3.arc` with an inner radius of zero. The chart positions text labels at each arc's centroid and appends a separate legend with rectangles and value labels. The code relies on D3 v5 APIs including `scaleOrdinal` for colors and `format` for tick value formatting, with styles defined in an external stylesheet.
AI-generated descriptionMIT Licensed