Pie Chart
✓ Published0🌍 Public
A pie chart displays the average calories burned for each workout type—Cardio, HIIT, Strength, and Yoga—based on data from lifestyle.csv. The code uses D3 v7’s `d3.csv`, `d3.rollup`, and `d3.mean` to aggregate the data, then `d3.pie` and `d3.arc` to generate the SVG paths. A categorical color scale with `d3.schemeSet2` colors each segment, and labels are placed using `arc.centroid`. A legend is appended manually using D3 selections.
AI-generated descriptionMIT Licensed