D3.js Step by Step: Step 5 - Adding Tooltips
✓ Published0🌍 Public
This donut chart visualizes aggravated assault counts by state using the FBI’s estimated_crimes.csv dataset, with each slice colored by year via `d3.scale.category20b()`. Hovering over a slice triggers a tooltip that displays the state name, assault count, and a calculated percentage, using `d3.svg.arc`, `d3.layout.pie`, and mouseover events. The SVG chart includes a legend and fixed dimensions, with tooltips styled as absolutely positioned HTML divs.
AI-generated descriptionMIT Licensed