🌍 Public
Viewing a saved revision (read-only)
41d0b10d8f494390aa391ef495512333
Making an Interactive Pie Chart
A donut chart displays income categories with a tooltip showing percentage on hover. The visualization uses D3 v5’s `pie`, `arc`, `scaleOrdinal`, and `csv` functions to load income data and render SVG paths. Labels are positioned using the `labelArc.centroid` method, while tooltips appear via mouseover events and are hidden on mouseout, with interaction handling for both slices and the tooltip itself.
AI-generated description