Skip to main content
100%

Pie Chart with Legend

✓ Published0🌍 Public
VVenkat-Dhulipalla
Last edited Mar 25, 2023
Created on Mar 24, 2023

A pie chart breaks categorical data from a CSV file into five colored slices, each labeled with a fruit name and accompanied by a custom HTML legend built from colored squares. The chart is rendered as SVG using D3.js v6, with the `d3.pie()` layout computing arc angles and `d3.arc()` generating the paths. The legend is positioned absolutely beside the chart, and each slice uses a semi-transparent fill with white strokes to visually separate segments.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

MIT Licensed

Similar vizzes