Skip to main content
100%

ICE - 7 Pie Chart

✓ Published0🌍 Public
PPriyanka7002
Last edited Mar 28, 2022
Created on Mar 28, 2022

This example visualizes smartphone sales in millions from 2012 to 2021 as a pie chart, with each slice representing a year's sales. The chart uses d3.pie to compute the arc angles and d3.arc to generate the SVG path segments, with d3.scaleOrdinal assigning a fixed color palette to each slice. Slices display their numerical sales values, while a side legend pairs each year with a colored rectangle and its corresponding sales figure. Data is loaded as CSV from a GitHub gist using d3.csv, and the SVG canvas is centered with a heading above the chart.

AI-generated description
MIT Licensed

Similar vizzes