Skip to main content
100%

DV ICE7- Pie Chart for Monthly spendings data

✓ Published1🌍 Public
Ppravalika.thogaru10@gmail.com
Last edited Mar 12, 2023
Created on Mar 12, 2023
Forked from Pie Chart ICE-7

This example shows a pie chart of monthly spending across departments, with each slice labeled and a legend displaying both the department name and its expenditure amount in dollars. The chart is rendered as an SVG using D3 v5, with the pie layout and arc generator (via `d3.pie` and `d3.arc`) computing slice positions and paths. A categorical color scale (`scaleOrdinal`) assigns colors to slices, and text elements are placed at arc centroids using `arcGenerator.centroid`. Data is loaded asynchronously from a CSV file via `d3.csv`, and the legend is built manually with appended rectangles and text elements.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes