Skip to main content
100%

Fork of activity7, question1 piechart

✓ Published1🌍 Public
Ssahithitoomu@gmail.com
Last edited Apr 6, 2025
Created on Apr 6, 2025

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
MIT Licensed

Similar vizzes