🌍 Public
Viewing a saved revision (read-only)
e2fe6f8076484fbd95b4011811a581f5
Easy Pie Chart
This example displays a simple pie chart with four slices, using colors and numeric labels to represent the provided dataset. The chart is built with D3 v4 on an SVG canvas, where a group element is centered and `d3.pie()` computes the start and end angles for each arc. These angles are rendered using `d3.arc()` with a specified inner and outer radius and pad angle, while `d3.scaleOrdinal` assigns the slice colors. Each wedge is labeled with its data value using `arc.centroid` to position the text.
AI-generated description