Skip to main content
100%

Pie Chart Labels with missing data

✓ Published0🌍 Public
KKacieW
Last edited Jun 11, 2018
Created on Jun 11, 2018

This donut chart demonstrates how to label slices with external text and leader lines, and it gracefully handles missing or new data when the button is clicked. The randomized data updates trigger smooth animated transitions using `d3.layout.pie`, `d3.svg.arc`, and `transition.attrTween` to interpolate between states. Labels and polylines reposition via `outerArc.centroid` and tweened transforms, with the duration controlled by a slider. The example uses D3 v3 to render SVG, and it merges old and new datasets to keep removed slices from disappearing abruptly.

AI-generated description

This variation of a donut chart demonstrates how to add labels with lines and also works with missing/new data. Clicking on the button changes the displayed data.

forked from <a href='http://bl.ocks.org/dbuezas/'>dbuezas</a>'s block: <a href='http://bl.ocks.org/dbuezas/9572040'>Pie Chart Labels with missing data</a>

mit Licensed

Similar vizzes