Skip to main content
100%

Fork of Reusable pie chart

✓ Published0🌍 Public
Vvaishnavgck@gmail.com
Last edited Apr 1, 2025
Created on Apr 1, 2025

This example is a reusable pie chart that visualizes categorical data from a CSV file containing wine characteristics. It shows how each category's proportion is represented as a slice of the pie, with labels positioned at each slice's centroid and a color scale applied via `d3.scaleOrdinal` with the `d3.schemeCategory10` palette. The chart is rendered as an SVG using D3 v7, with pie geometry computed through the `d3.pie` and `d3.arc` APIs. Hovering over a slice triggers a brief animation that expands the arc outward using D3 transitions, providing interactive feedback. The data is loaded asynchronously via `d3.csv`, and numeric values are converted before the slices are appended.

AI-generated description
MIT Licensed

Similar vizzes