Fork of Fork of Fork of ICE7 Pie Chart
✓ Published0🌍 Public
This example shows a pie chart of the top ten cricketers’ career runs, with each slice sized proportionally to a player’s total. A legend lists each player name alongside its value. The code loads data from a JSON file, uses d3.pie to compute angles and d3.arc to generate SVG path segments, while d3.scaleOrdinal with d3.schemeCategory10 assigns slice colors. Legends are manually appended as SVG rectangles and text elements, with run values formatted using d3.format.
AI-generated descriptionMIT Licensed