DV ICE7- Pie Chart for Monthly spendings data
✓ Published1🌍 Public
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 descriptionA demonstration of how to start using D3 version 6.
MIT Licensed