Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Pie Chart

Public visualization

Fork of Fork of Pie Chart

0 stars0🌍 Public
Eeravellisaimeghana
Last edited Mar 29, 2022
Created on Mar 29, 2022
Forked from Fork of Pie Chart

This example shows the amount of protein in grams present in various cereals as a pie chart, with a legend identifying each cereal and its corresponding protein value. The visualization loads a CSV dataset from a GitHub gist using `d3.csv` and renders the chart as SVG. It uses `d3.pie` to compute the arc angles, `d3.arc` to generate the path segments, and `d3.scaleOrdinal` to assign colors from a fixed palette. A separate legend group is built by appending rectangles and text labels for each data entry.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed