Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

lm_piechart_Task9

Public visualization

Viewing a saved revision (read-only)

7eb46c6e31eb4c0ab7f7ea303ab1e5fa

lm_piechart_Task9

0 stars0🌍 Public
LLokesh Madem
Last edited Apr 21, 2024
Created on Apr 21, 2024

A pie chart visualizes profit distribution across regions, with each slice's area proportional to the region's profit value and labeled in a legend alongside the corresponding profit amount. The chart renders as an SVG using D3 v5 APIs, including `d3.pie()` to compute arc angles, `d3.arc()` to generate path segments, and `d3.scaleOrdinal` with `d3.schemeCategory10` for color encoding. Data is loaded asynchronously from a remote JSON file provided via GitHub Gist, with profit values parsed as numbers before rendering. The legend maps each color to a region name and its profit value.

AI-generated description