Skip to main content
100%

Pie chart

✓ Published2🌍 Public
KKrister
Last edited Apr 21, 2020
Created on Apr 17, 2020

This example shows a donut-style pie chart that animates between two datasets after a three-second delay. The initial render displays four categorical slices sized 100,000, then re-renders with five new proportions representing a different dataset. The chart uses d3.pie to compute arc angles and d3.arc with an inner radius to create the donut shape, while a d3.scaleOrdinal assigns categorical colors. The visualization is drawn as SVG elements, and both datasets are hardcoded in JavaScript.

AI-generated description

Making a pie chart.

MIT Licensed

Similar vizzes