# SliceData

Jumping back to our previous example, we provided two `SliceData` to show a PieChart containing two slices.

`SliceData` defines the pie piece in a PieChart. It also provides the `radius` of the Pie and styling options should you choose to customize each individual pie slices.

Let's modify the original PieChart example, and represent every Pie with a Different Radius.

{% tabs %}
{% tab title="Code Sample" %}

```dart
...
import 'package:chart_it/chart_it.dart';

class TestPieCharts extends StatefulWidget {
  const TestPieCharts({Key? key}) : super(key: key);

  @override
  State<TestPieCharts> createState() => _TestPieChartsState();
}

class _TestPieChartsState extends State<TestPieCharts> {
  @override
  Widget build(BuildContext context) {
    return PieChart(
      data: PieSeries(
        slices: <SliceData>[
          SliceData(
            label: (_, value) => 'Quarter 1',
            style: SliceDataStyle(
              color: Colors.pink,
              radius: 90,
            ),
            value: 18,
          ),
          SliceData(
            label: (_, value) => 'Quarter 2',
            style: SliceDataStyle(
              color: Colors.orange,
              radius: 130,
            ),
            value: 32,
          ),
          SliceData(
            label: (_, value) => 'Quarter 3',
            style: SliceDataStyle(
              color: Colors.cyanAccent,
              radius: 100,
            ),
            value: 48,
          ),
          SliceData(
            label: (_, value) => 'Quarter 4',
            style: SliceDataStyle(
              color: Colors.blueAccent,
              radius: 110,
            ),
            value: 76,
          ),
        ],
      ),
    );
  }
}
```

{% endtab %}

{% tab title="Result" %}

<figure><img src="https://672051664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JD7NLiao8wvvuzkAjT9%2Fuploads%2FUMBXfhJAxlRrZ0pZhiK1%2FScreenshot%202023-04-26%20at%201.25.04%20PM.png?alt=media&#x26;token=802cce9b-52b4-4daf-9046-5ac3dcc16b48" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Even if you can provide custom radius for a pie slice, it won't exceed the `max_radius` limit which is calculated internally based on the Widget's Constraints.
{% endhint %}

### Class Properties

| Name       | Type              | Required                               | Default Value |
| ---------- | ----------------- | -------------------------------------- | ------------- |
| value      | `num`             | <mark style="color:red;">true</mark>   | -             |
| style      | `SliceDataStyle?` | <mark style="color:blue;">false</mark> | `null`        |
| label      | `SliceMapper?`    | <mark style="color:blue;">false</mark> | `null`        |
| labelStyle | `ChartTextStyle?` | <mark style="color:blue;">false</mark> | `null`        |
