Skip to main content
100%

donut chart with tooltip and legend

✓ Published0🌍 Public
Aallyraza
Last edited Oct 10, 2017
Created on Oct 10, 2017

This donut chart displays four categorical values as colored arcs, with a legend mapping each label to its corresponding color and a tooltip that follows the mouse to show the current cursor coordinates. Built with D3 v4, it uses `d3.pie` and `d3.arc` to generate the donut geometry, `d3.scaleOrdinal` with `d3.schemeCategory20c` for coloring, and `d3.scaleBand` to position the legend items. The SVG renders the arcs and legend, while a custom tooltip div appears on mouseover, updates its text via `d3.event.pageX` and `pageY`, and hides on mouseout.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/56b15b919de4d073a48677bd2f89e274'>gauge with gradient</a>

mit Licensed

Similar vizzes