Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pie Chart with Legend

Public visualization

Pie Chart with Legend

0 stars0🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed