🌍 Public
Viewing a saved revision (read-only)
0c2ea63e57c74ede9fe74765282b34e1
Fork of activity7, question1 piechart
This example shows a simple pie chart for a categorical dataset with five categories (A–E), each represented by a colored slice with a value label. The chart is rendered as SVG using D3.js v6, with a legend displayed to the right of the pie. The code uses `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to compute slice geometry, apply colors from `d3.schemeCategory10`, and position the legend elements. Axis labels for categories and values are added manually, though no actual axes are present. The data is hardcoded as a sample array.
AI-generated description