🌍 Public
Viewing a saved revision (read-only)
4e55e0c4e56e46a99981fa97a56c18b3
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