Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity7_Question 1

Public visualization

Viewing a saved revision (read-only)

845212048750433cb73434fd9892ca5f

Activity7_Question 1

0 stars0🌍 Public
Hharinihari6791@gmail.com
Last edited Apr 10, 2025
Created on Apr 10, 2025
Forked from Hello VizHub

A pie chart visualizes the percentage distribution of a budget across five categories: Food, Transport, Housing, Savings, and Entertainment. The chart uses d3.pie() to compute arc angles and d3.arc() to generate SVG path slices, with a color scale mapping each category to a distinct color. Percent values are labeled inside each slice using arc.centroid() for positioning, and a separate legend lists the categories with their corresponding colors. The code defines fixed data in a JavaScript array and renders the chart as an SVG element using D3 v7.

AI-generated description