7.1 Question 1
✓ Published0🌍 Public
This example shows a fruit distribution pie chart, visualizing the quantity of each fruit in a CSV dataset loaded from a GitHub gist. D3 v5 loads the data with `d3.csv`, converts it to an object mapping fruit names to numeric quantities, and uses `d3.pie` and `d3.arc` to generate the SVG paths. Each slice is filled with a categorical color from `d3.schemeSet2` via `d3.scaleOrdinal`, and labeled with the fruit name using SVG text elements positioned at each arc’s centroid.
AI-generated descriptionMIT Licensed