Skip to main content
100%

Pie Chart

✓ Published2🌍 Public
Ppvvaishnavi93@gmail.com
Last edited Mar 27, 2026
Created on Mar 27, 2026

This pie chart displays monthly expense categories—Rent, Food, Travel, Shopping, and Bills—with proportional slices and a labeled legend. Built with D3 v7, it loads data from a CSV file, computes arc paths using `d3.pie()` and `d3.arc()`, and positions category labels via `labelArc.centroid(d)`. A categorical color scale (`d3.scaleOrdinal`) assigns colors, while the SVG rendering includes a title and a legend showing each category’s value. The chart is generated entirely with SVG elements and a custom legend.

AI-generated description
MIT Licensed

Similar vizzes