Skip to main content
100%

Pie chart of Vegetables based on price US Dollars

✓ Published0🌍 Public
NNagasharan Sai Nandyala
Last edited Apr 1, 2025
Created on Mar 30, 2025
Forked from Activity6_Q3

This pie chart visualizes the distribution of vegetable prices in US dollars, with each slice representing a vegetable's total price proportion. The SVG chart is generated using D3.js v6, with a legend on the right side and percentage labels displayed on each slice. The code uses `d3.csv()` to load data from a GitHub gist, then `d3.rollups()` to aggregate prices by item name and `d3.pie()` to compute the pie geometry. Colors come from `d3.scaleOrdinal(d3.schemeCategory10)`, and slices are drawn as SVG paths using `d3.arc()` with a custom centroid-based label placement.

AI-generated description
MIT Licensed

Similar vizzes