Viewing a saved revision (read-only)
275608490d2c41fabb01dc4cc44d4e76
Pie chart-Mahesh-ICE 7
This pie chart visualizes Amazon’s 2022 revenue by state, showing each state’s proportional share of total revenue. The chart uses D3 v5’s `pie()` and `arc()` generators to compute and render SVG slices, with a legend on the right listing states and their revenue values. The code fetches data from a CSV file via `csv()` and colors each slice using `scaleOrdinal`. Text labels display revenue in thousands (e.g., “12.34K”), formatted with D3’s `format()`. The visualization is rendered entirely with SVG, and the legend includes both state names and corresponding revenue amounts.
AI-generated descriptionA program that loads in some data using d3 utilities, and uses react state to keep track of the data.