Pie Chart

A composable pie chart built with D3.js arcs and Tailwind styling.

Example

3020251510
Fruits
100
Apples
Bananas
Cherries
Dates
Elderberries

Installation

./components/charts/PieChart.tsx

How It Works

The Pie Chart is built using d3.pie and d3.arc to generate slice paths. It supports labels and a responsive legend.

  • PieChart.Container – Provides chart context
  • PieChart.Slice – Renders each pie segment
  • PieChart.Legend – Displays series names and colors