🌍 Public
Viewing a saved revision (read-only)
96c3ae4e567449d0918659925c0c3c22
Activity 7_Question 1
This pie chart displays the distribution of causes of death in the United States for 2023, with each slice labeled by its percentage of total deaths. The code uses D3 v7 with the `d3.pie` and `d3.arc` generators to compute and draw the arcs, while `d3.scaleOrdinal` with `d3.schemeSet2` assigns categorical colors. Data is loaded remotely from a CSV file via `d3.csv`, and a custom legend on the right pairs each cause with its corresponding percentage. The SVG rendering includes axis labels and bold percentage text positioned using `labelArc.centroid`.
AI-generated description