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

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

CartesianSeries<TItem>.TooltipLabel

CartesianSeries<TItem>.TooltipTitle

CartesianSeries<TItem>.TooltipValue

CartesianSeries<TItem>.PickColor

CartesianSeries<TItem>.Dispose

CartesianSeries<TItem>.InvokeClick

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

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

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

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

CoordinateSystemlink

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

CurrentRadiuslink

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.

Fillslink

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.

PositiveItemslink

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

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.

ShowTooltipOnLegendlink

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

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

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

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

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

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

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

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

Containslink

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

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

Converts degrees to radians.

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

GetDataLabelslink

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>

MeasureLegendlink

Declaration
public override double MeasureLegend()
Returns
Type Description
double

Renderlink

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

RenderLegendItemlink

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

Segmentlink

Creates SVG path that renders the specified segment.

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

ToCartesianlink

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

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

TooltipStylelink

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 🗙