🌍 Public
Viewing a saved revision (read-only)
5e011dfd3c484c6ca6a4ec45f420c4d8
Making a Pie Chart
This example shows a donut chart of income sources—Sales, Dividends, and Interest—with labeled slices and a custom color scale. It loads data from a CSV file, converts the amounts to thousands, and renders the chart as SVG. The code uses D3 v5 APIs including `d3.pie`, `d3.arc`, `scaleOrdinal`, and `csv` to compute slice angles, generate paths, and position labels via arc centroids.
AI-generated description