Pie Chart

A colorful and interactive pie/donut chart built with D3.js and styled using Tailwind.

Example

Pie Chart

Visualize proportions and parts-of-a-whole with smooth donut charts.

3020251510
Total100
Apples
Bananas
Cherries
Dates
Elderberries
classic MODE

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