Pie_Chart_ICE_7
✓ Published0🌍 Public
This example shows flight ticket prices from the US to India on June 21st, using a pie chart where each slice’s size and label represent the price in dollars for a different airline. The chart renders in SVG and includes a legend listing airline names alongside their corresponding prices in thousands. The code uses D3 v5’s `pie`, `arc`, `scaleOrdinal`, and `csv` functions to load data from a GitHub Gist, compute slice geometry, and assign a fixed set of ten named colors to the segments. Text labels are placed at slice centroids via `arc.centroid()`.
AI-generated descriptionMIT Licensed