# RadzenPieSeries<TItem> Class

A chart series that displays data as a circular pie chart with segments representing proportions of a whole. RadzenPieSeries is ideal for showing percentage breakdowns, composition analysis, or relative comparisons of parts to a total. Divides a circle into segments where each segment's angle is proportional to its value relative to the sum of all values. Supports segment color customization via Fills, borders via Strokes with custom radius and positioning, TotalAngle to create semi-circles or partial pie charts (e.g., gauge-like displays), StartAngle controlling where the first segment begins, optional labels showing values or percentages on segments, interactive tooltips showing category/value/percentage, and legend where each segment appears as a legend item using category values. Use CategoryProperty for segment labels (shown in legend/tooltip) and ValueProperty for the numeric value determining segment size. For a donut chart (pie with hollow center), use RadzenDonutSeries instead.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenChartComponentBase](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenChartComponentBase.md)
- [CartesianSeries<TItem>](https://blazor.radzen.com/docs/api/Radzen.Blazor.CartesianSeries-1.md)
- RadzenPieSeries<TItem>

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IChartSeries](https://blazor.radzen.com/docs/api/Radzen.Blazor.IChartSeries.md)
- [IChartValueAxisSeries](https://blazor.radzen.com/docs/api/Radzen.Blazor.IChartValueAxisSeries.md)

## Syntax

```csharp
public class RadzenPieSeries<TItem> : CartesianSeries<TItem>, IComponent, IHandleEvent, IHandleAfterRender, IChartSeries, IChartValueAxisSeries
```

## Type Parameters

| Name | Description |
|------|-------------|
| TItem | The type of data items in the series. Each item represents one pie segment. |

## Examples

Basic pie chart:

```razor
<RadzenChart>
    <RadzenPieSeries Data=@marketShare CategoryProperty="Company" ValueProperty="Share" />
</RadzenChart>
```

Pie with custom colors and data labels:

```razor
<RadzenChart>
    <RadzenPieSeries Data=@data CategoryProperty="Category" ValueProperty="Value" 
                     Fills=@(new[] { "#FF6384", "#36A2EB", "#FFCE56", "#4BC0C0" })>
        <RadzenSeriesDataLabels Visible="true" />
    </RadzenPieSeries>
</RadzenChart>
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenPieSeries<TItem>()` | A chart series that displays data as a circular pie chart with segments representing proportions of a whole. RadzenPieSeries is ideal for showing percentage breakdowns, composition analysis, or relative comparisons of parts to a total. Divides a circle into segments where each segment's angle is proportional to its value relative to the sum of all values. Supports segment color customization via Fills, borders via Strokes with custom radius and positioning, TotalAngle to create semi-circles or partial pie charts (e.g., gauge-like displays), StartAngle controlling where the first segment begins, optional labels showing values or percentages on segments, interactive tooltips showing category/value/percentage, and legend where each segment appears as a legend item using category values. Use CategoryProperty for segment labels (shown in legend/tooltip) and ValueProperty for the numeric value determining segment size. For a donut chart (pie with hollow center), use RadzenDonutSeries instead. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| Color | `string` |  |
| CoordinateSystem | [`CoordinateSystem`](https://blazor.radzen.com/docs/api/Radzen.CoordinateSystem.md) |  |
| CornerRadius | `double` | Gets or sets the corner radius in pixels used to round the corners of each segment. A pie segment has its two outer corners and its center apex rounded; a donut segment has all four corners rounded. The value is clamped per segment so that adjacent corners never overlap. |
| CurrentRadius | `double` | Returns the current radius - either a specified Radius or automatically calculated one. |
| ExplodeOffset | `double` | Gets or sets the distance in pixels that a segment moves outward from the center when hovered. Set to a value greater than 0 to enable the explode-on-hover effect. Also sets the distance for segments pulled out permanently via ExplodedProperty. |
| ExplodedProperty | `string` | Gets or sets the name of a boolean property that marks segments as exploded (pulled out from the center) in their normal state, not just on hover. Requires ExplodeOffset greater than 0, which sets the distance. Exploded segments stay pulled out and move a little further on hover; other segments still explode on hover. |
| FillMode | [`FillMode`](https://blazor.radzen.com/docs/api/Radzen.Blazor.FillMode.md) | Specifies how the segments are filled. Set to Solid by default. Use Gradient for a radial fill that holds the full segment color through the inner part of the radius and eases to a faded outer area. The faded part lets the chart background show through, so it is lighter on light themes and darker on dark themes. Use None to render only the outline. |
| Fills | `IEnumerable<string>` | Gets or sets a collection of fill colors applied to individual pie segments in sequence. Each segment gets the color at its index position. If fewer colors than segments, colors are reused cyclically. If not set, uses the chart's color scheme. |
| GradientEndOpacity | `double` | Specifies the opacity of the full-color part of the gradient - the center of a pie, or the outer rim of a donut ring. Used when FillMode is Gradient. |
| GradientInnerOffset | `double` | Specifies the radius fraction (0-1) at which the gradient holds the full color before it starts to fade. Used when FillMode is Gradient. |
| GradientMidOffset | `double` | Specifies the radius fraction (0-1) of the gradient's faded middle stop. Used when FillMode is Gradient. |
| GradientRimOpacity | `double` | Specifies the opacity at the very rim of the gradient. Used when FillMode is Gradient. |
| GradientStartOpacity | `double` | Specifies the opacity of the faded middle stop of the gradient. Below 1 it lets the chart background show through, so it eases lighter on light themes and darker on dark themes. Used when FillMode is Gradient. |
| PositiveItems | `IList<TItem>` | Stores Data filtered to items greater than zero as an IList of TItem. |
| Radius | `double?` | Gets or sets the radius of the pie chart in pixels. If not set, the radius is automatically calculated to fit the available chart space. |
| RadiusProperty | `string` | Gets or sets the name of the property that provides a per-item radius value. When set, each pie/donut segment can have a different outer radius, allowing visual differentiation by size. The property should return a numeric value that is used to scale the radius relative to the maximum value. |
| SegmentGap | `double` | Gets or sets the width in pixels of a uniform gap drawn between adjacent segments. Each segment's two radial edges are inset by half this value, so neighboring segments are separated by a constant-width space from the rim to the center (or inner hole), independent of segment size. Composes with CornerRadius. A segment too narrow for the gap is skipped. |
| ShowTooltipOnLegend | `bool` | Gets or sets a value indicating whether hovering or clicking a legend item displays the tooltip for the corresponding pie/donut segment. This is useful when small slices are difficult to hover over directly on the chart. |
| StartAngle | `double` | Gets or sets the starting angle (in degrees) from which pie segments begin rendering, measured clockwise from the right (0°). Use to rotate the pie: 90° (top), 0° (right), 180° (left), 270° (bottom). |
| StrokeWidth | `double` | Gets or sets the width of the pie segment borders in pixels. Set to 0 for no borders, or increase to make segment divisions more visible. |
| Strokes | `IEnumerable<string>` | Gets or sets a collection of stroke (border) colors applied to individual pie segments in sequence. Use with StrokeWidth to create visible segment borders. |
| TotalAngle | `double` | Gets or sets the total angle span of the pie in degrees. Use 360 for a full circle, 180 for a semi-circle, or other values for partial pies (useful for gauge-like visualizations). |
| X | `double?` | Gets or sets the horizontal center position of the pie chart in pixels. If not set, the pie is automatically centered horizontally within the chart area. |
| Y | `double?` | Gets or sets the vertical center position of the pie chart in pixels. If not set, the pie is automatically centered vertically within the chart area. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `Contains(double x, double y, double tolerance)` | `bool` |  |
| `DataAt(double x, double y)` | `ValueTuple<object, Point>` |  |
| `DegToRad(double degrees)` | `double` | Converts degrees to radians. |
| `GetDataLabels(double offsetX, double offsetY)` | `IEnumerable<Rendering.ChartDataLabel>` |  |
| `GetDataLabels(double offsetX, double offsetY, DataLabelPosition position)` | `IEnumerable<Rendering.ChartDataLabel>` |  |
| `MeasureLegend()` | `double` |  |
| `MeasureLegendItems()` | `IEnumerable<double>` |  |
| `Render(ScaleBase categoryScale, ScaleBase valueScale)` | `RenderFragment` |  |
| `RenderLegendItem(bool clickable)` | `RenderFragment` |  |
| `Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle)` | `string` | Creates SVG path that renders the specified segment, rounding its corners by CornerRadius. Parameters: `x`: The x. `y`: The y. `radius`: The radius. `innerRadius`: The inner radius. `startAngle`: The start angle. `endAngle`: The end angle. |
| `Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle, double cornerRadius)` | `string` | Creates SVG path that renders the specified segment, rounding its corners by CornerRadius. Parameters: `x`: The x. `y`: The y. `radius`: The radius. `innerRadius`: The inner radius. `startAngle`: The start angle. `endAngle`: The end angle. |
| `ToCartesian(double x, double y, double radius, double degrees)` | `ValueTuple<double, double>` | Converts radial coordinates to to cartesian. Parameters: `x`: The x. `y`: The y. `radius`: The radius. `degrees`: The degrees. |
| `TooltipClass(TItem item)` | `string` |  |
| `TooltipStyle(TItem item)` | `string` |  |

## Inherited Members

- From [CartesianSeries<TItem>](https://blazor.radzen.com/docs/api/Radzen.Blazor.CartesianSeries-1.md): BandIntersects, CategoryProperty, ChildContent, ClipToPlotRange, ComposeCategory, ComposeValue, Data, Dispose, GetCategories, GetMean, GetMedian, GetMode, GetRawValueGetter, GetScaledDataPoints, GetTitle, GetTooltipPosition, GetTrend, Hidden, IncludeZeroInValueScale, Initialize, InsidePolygon, InvokeClick, IsDate, IsNumeric, IsValueNullable, Items, MarkerSize, MarkerType, Markers, Overlays, PickColor, RenderOverlays, RenderSharedTooltipItem, RenderTooltip, RenderTopOverlays, RenderingOrder, RequireChart, SetParametersAsync, ShowActivePoint, ShowInLegend, ShowLineInLegend, Title, TooltipLabel, TooltipTemplate, TooltipTitle, TooltipValue, TransformCategoryScale, TransformValueScale, TryGetPlotRange, ValueAxisName, ValueProperty, Visible
- From [RadzenChartComponentBase](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenChartComponentBase.md): Chart, DidParameterChange, ShouldRefreshChart, ValidateParameters
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnAfterRenderAsync, OnInitialized, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

