Skip to main content
100%

Pie Chart

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Dec 19, 2012

Ten random values are visualized as a pie chart that first animates from a single point into a full circle, then morphs into a donut chart with a hole in the center. The animation uses two successive `transition.attrTween` calls on the path's `d` attribute, with `bounce` and `elastic` easing functions. The SVG is built using the D3 v3 API, including `d3.layout.pie()`, `d3.svg.arc()`, and `d3.scale.category20()` for coloring each slice.

AI-generated description

So fun, right? But think twice before you use gratuitous enter animations; they can be annoying! The motion is distracting if you’re reading text elsewhere on the page. And, if you’re looking at the visualization, the animation forces you to wait. Instead, use animation to facilitate by making it easier to follow data across views, or as a form of visual explanation. For more details, read Object Constancy.

gpl-3.0 Licensed

Similar vizzes