---
title: PieChart
description: JSON Schema for the PieChart component.
---

Pie or donut chart.

```json
{
  "type": "object",
  "properties": {
    "type": {
      "const": "PieChart",
      "default": "PieChart",
      "type": "string"
    },
    "id": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "HTML id attribute for CSS targeting. Applied to the outermost element."
    },
    "cssClass": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "CSS/Tailwind classes for styling. Accepts a Responsive() for breakpoint-aware classes."
    },
    "onMount": {
      "default": null,
      "description": "Action(s) to execute when this component mounts."
    },
    "data": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "string"
        }
      ],
      "description": "Row data or `{{ interpolation }}` reference"
    },
    "dataKey": {
      "description": "Numeric value field",
      "type": "string"
    },
    "nameKey": {
      "description": "Label field",
      "type": "string"
    },
    "height": {
      "default": 300,
      "description": "Chart height in pixels",
      "type": "integer"
    },
    "innerRadius": {
      "default": 0,
      "description": "Inner radius (>0 for donut)",
      "type": "integer"
    },
    "showLabel": {
      "default": false,
      "description": "Show labels on slices",
      "type": "boolean"
    },
    "paddingAngle": {
      "default": 0,
      "description": "Gap between slices in degrees",
      "type": "integer"
    },
    "showLegend": {
      "default": true,
      "description": "Show legend",
      "type": "boolean"
    },
    "showTooltip": {
      "default": true,
      "description": "Show tooltip on hover",
      "type": "boolean"
    },
    "animate": {
      "default": true,
      "description": "Animate transitions when data changes",
      "type": "boolean"
    }
  },
  "required": [
    "type",
    "data",
    "dataKey",
    "nameKey"
  ]
}
```
