Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pie_Chart-Task9

Public visualization

Viewing a saved revision (read-only)

4d6b4178d31b45d4b70f3e50b8e22762

Pie_Chart-Task9

0 stars0🌍 Public
SSree Yuktha Sunkara
Last edited Apr 25, 2024
Created on Apr 23, 2024

This pie chart shows the top five crop yields in Andhra Pradesh for 2017, displaying each crop’s percentage of the total yield as labeled slices with a custom color scale. It uses D3 v5 with `d3.csv`, `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to load data from a remote ICRISAT CSV, filter by state and year, aggregate yields, and render the SVG chart with an interactive legend. The code computes percentages from summed values and positions text labels using `arc.centroid`.

AI-generated description