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.

Inheritance

Object

ComponentBase

RadzenChartComponentBase

CartesianSeries<TItem>

RadzenPieSeries<TItem>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IChartSeries

IChartValueAxisSeries

Inherited Members

CartesianSeries<TItem>.RequireChart

CartesianSeries<TItem>.ComposeCategory

CartesianSeries<TItem>.ComposeValue

CartesianSeries<TItem>.IsValueNullable

CartesianSeries<TItem>.GetRawValueGetter

CartesianSeries<TItem>.IsDate

CartesianSeries<TItem>.IsNumeric

CartesianSeries<TItem>.GetCategories

CartesianSeries<TItem>.TransformCategoryScale

CartesianSeries<TItem>.TransformValueScale

CartesianSeries<TItem>.RenderOverlays

CartesianSeries<TItem>.RenderTopOverlays

CartesianSeries<TItem>.SetParametersAsync

CartesianSeries<TItem>.Initialize

CartesianSeries<TItem>.InsidePolygon

CartesianSeries<TItem>.RenderTooltip

CartesianSeries<TItem>.RenderSharedTooltipItem

CartesianSeries<TItem>.GetTooltipPosition

CartesianSeries<TItem>.GetMedian

CartesianSeries<TItem>.GetMean

CartesianSeries<TItem>.GetMode

CartesianSeries<TItem>.GetTrend

CartesianSeries<TItem>.GetScaledDataPoints

CartesianSeries<TItem>.GetTitle

CartesianSeries<TItem>.TooltipLabel

CartesianSeries<TItem>.TooltipTitle

CartesianSeries<TItem>.TooltipValue

CartesianSeries<TItem>.PickColor

CartesianSeries<TItem>.Dispose

CartesianSeries<TItem>.InvokeClick

CartesianSeries<TItem>.ValueAxisName

CartesianSeries<TItem>.Title

CartesianSeries<TItem>.ChildContent

CartesianSeries<TItem>.TooltipTemplate

CartesianSeries<TItem>.Overlays

CartesianSeries<TItem>.CategoryProperty

CartesianSeries<TItem>.Visible

CartesianSeries<TItem>.Hidden

CartesianSeries<TItem>.ShowInLegend

CartesianSeries<TItem>.ValueProperty

CartesianSeries<TItem>.RenderingOrder

CartesianSeries<TItem>.Data

CartesianSeries<TItem>.Items

CartesianSeries<TItem>.Markers

CartesianSeries<TItem>.MarkerType

CartesianSeries<TItem>.ShowActivePoint

CartesianSeries<TItem>.ShowLineInLegend

CartesianSeries<TItem>.MarkerSize

RadzenChartComponentBase.ShouldRefreshChart

RadzenChartComponentBase.ValidateParameters

RadzenChartComponentBase.DidParameterChange

RadzenChartComponentBase.Chart

ComponentBase.OnInitialized

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.OnAfterRenderAsync

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

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

Type Parameters

Name Description
TItemThe type of data items in the series. Each item represents one pie segment.

Examples

Basic pie chart:

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

Pie with custom colors and data labels:

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

Constructors

RadzenPieSeries<TItem>Link to this section

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.

Declaration
public RadzenPieSeries<TItem>()

Properties

ColorLink to this section

Declaration
public string Color { get; }
Property Value
Type Description
string

CoordinateSystemLink to this section

Declaration
public CoordinateSystem CoordinateSystem { get; }
Property Value
Type Description
CoordinateSystem

CornerRadiusLink to this section

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.

Declaration
public double CornerRadius { get; set; }
Property Value
Type Description
doubleGets 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.

CurrentRadiusLink to this section

Returns the current radius - either a specified Radius or automatically calculated one.

Declaration
protected double CurrentRadius { get; }
Property Value
Type Description
doubleReturns the current radius - either a specified Radius or automatically calculated one.

ExplodeOffsetLink to this section

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.

Declaration
public double ExplodeOffset { get; set; }
Property Value
Type Description
doubleGets 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.

ExplodedPropertyLink to this section

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.

Declaration
public string ExplodedProperty { get; set; }
Property Value
Type Description
stringGets 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.

FillModeLink to this section

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.

Declaration
public FillMode FillMode { get; set; }
Property Value
Type Description
FillModeSpecifies 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.

FillsLink to this section

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.

Declaration
public IEnumerable<string> Fills { get; set; }
Property Value
Type Description
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.

GradientEndOpacityLink to this section

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.

Declaration
public double GradientEndOpacity { get; set; }
Property Value
Type Description
doubleSpecifies 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.

GradientInnerOffsetLink to this section

Specifies the radius fraction (0-1) at which the gradient holds the full color before it starts to fade. Used when FillMode is Gradient.

Declaration
public double GradientInnerOffset { get; set; }
Property Value
Type Description
doubleSpecifies the radius fraction (0-1) at which the gradient holds the full color before it starts to fade. Used when FillMode is Gradient.

GradientMidOffsetLink to this section

Specifies the radius fraction (0-1) of the gradient's faded middle stop. Used when FillMode is Gradient.

Declaration
public double GradientMidOffset { get; set; }
Property Value
Type Description
doubleSpecifies the radius fraction (0-1) of the gradient's faded middle stop. Used when FillMode is Gradient.

GradientRimOpacityLink to this section

Specifies the opacity at the very rim of the gradient. Used when FillMode is Gradient.

Declaration
public double GradientRimOpacity { get; set; }
Property Value
Type Description
doubleSpecifies the opacity at the very rim of the gradient. Used when FillMode is Gradient.

GradientStartOpacityLink to this section

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.

Declaration
public double GradientStartOpacity { get; set; }
Property Value
Type Description
doubleSpecifies 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.

PositiveItemsLink to this section

Stores Data filtered to items greater than zero as an IList of TItem.

Declaration
protected IList<TItem> PositiveItems { get; }
Property Value
Type Description
IList<TItem>Stores Data filtered to items greater than zero as an IList of TItem.

RadiusLink to this section

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.

Declaration
public double? Radius { get; set; }
Property Value
Type Description
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.

RadiusPropertyLink to this section

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.

Declaration
public string RadiusProperty { get; set; }
Property Value
Type Description
stringGets 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.

SegmentGapLink to this section

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.

Declaration
public double SegmentGap { get; set; }
Property Value
Type Description
doubleGets 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.

ShowTooltipOnLegendLink to this section

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.

Declaration
public bool ShowTooltipOnLegend { get; set; }
Property Value
Type Description
boolGets 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.

StartAngleLink to this section

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).

Declaration
public double StartAngle { get; set; }
Property Value
Type Description
doubleGets 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).

StrokeWidthLink to this section

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.

Declaration
public double StrokeWidth { get; set; }
Property Value
Type Description
doubleGets 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.

StrokesLink to this section

Gets or sets a collection of stroke (border) colors applied to individual pie segments in sequence. Use with StrokeWidth to create visible segment borders.

Declaration
public IEnumerable<string> Strokes { get; set; }
Property Value
Type Description
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.

TotalAngleLink to this section

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).

Declaration
public double TotalAngle { get; set; }
Property Value
Type Description
doubleGets 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).

XLink to this section

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.

Declaration
public double? X { get; set; }
Property Value
Type Description
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.

YLink to this section

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.

Declaration
public double? Y { get; set; }
Property Value
Type Description
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

BuildRenderTreeLink to this section

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

ContainsLink to this section

Declaration
public override bool Contains(double x, double y, double tolerance)
Parameters
Type Name Description
double x
double y
double tolerance
Returns
Type Description
bool

DataAtLink to this section

Declaration
public override ValueTuple<object, Point> DataAt(double x, double y)
Parameters
Type Name Description
double x
double y
Returns
Type Description
ValueTuple<object, Point>

DegToRadLink to this section

Converts degrees to radians.

Declaration
protected double DegToRad(double degrees)
Parameters
Type Name Description
double degrees
Returns
Type Description
double

GetDataLabelsLink to this section

Declaration
public override IEnumerable<Rendering.ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
Parameters
Type Name Description
double offsetX
double offsetY
Returns
Type Description
IEnumerable<Rendering.ChartDataLabel>

GetDataLabelsLink to this section

Declaration
public override IEnumerable<Rendering.ChartDataLabel> GetDataLabels(double offsetX, double offsetY, DataLabelPosition position)
Parameters
Type Name Description
double offsetX
double offsetY
DataLabelPosition position
Returns
Type Description
IEnumerable<Rendering.ChartDataLabel>

MeasureLegendLink to this section

Declaration
public override double MeasureLegend()
Returns
Type Description
double

MeasureLegendItemsLink to this section

Declaration
public override IEnumerable<double> MeasureLegendItems()
Returns
Type Description
IEnumerable<double>

RenderLink to this section

Declaration
public override RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
Parameters
Type Name Description
ScaleBase categoryScale
ScaleBase valueScale
Returns
Type Description
RenderFragment

RenderLegendItemLink to this section

Declaration
protected override RenderFragment RenderLegendItem(bool clickable)
Parameters
Type Name Description
bool clickable
Returns
Type Description
RenderFragment

SegmentLink to this section

Creates SVG path that renders the specified segment, rounding its corners by CornerRadius.

Declaration
protected string Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle)
Parameters
Type Name Description
double x The x.
double y The y.
double radius The radius.
double innerRadius The inner radius.
double startAngle The start angle.
double endAngle The end angle.
Returns
Type Description
string

SegmentLink to this section

Creates SVG path that renders the specified segment, rounding its corners by CornerRadius.

Declaration
protected string Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle, double cornerRadius)
Parameters
Type Name Description
double x The x.
double y The y.
double radius The radius.
double innerRadius The inner radius.
double startAngle The start angle.
double endAngle The end angle.
double cornerRadius
Returns
Type Description
string

ToCartesianLink to this section

Converts radial coordinates to to cartesian.

Declaration
protected ValueTuple<double, double> ToCartesian(double x, double y, double radius, double degrees)
Parameters
Type Name Description
double x The x.
double y The y.
double radius The radius.
double degrees The degrees.
Returns
Type Description
ValueTuple<double, double>

TooltipClassLink to this section

Declaration
protected override string TooltipClass(TItem item)
Parameters
Type Name Description
TItem item
Returns
Type Description
string

TooltipStyleLink to this section

Declaration
protected override string TooltipStyle(TItem item)
Parameters
Type Name Description
TItem item
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙