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.
CartesianSeries<TItem>.RequireChart
CartesianSeries<TItem>.ComposeCategory
CartesianSeries<TItem>.ComposeValue
CartesianSeries<TItem>.IsValueNullable
CartesianSeries<TItem>.GetRawValueGetter
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>.ChildContent
CartesianSeries<TItem>.TooltipTemplate
CartesianSeries<TItem>.Overlays
CartesianSeries<TItem>.CategoryProperty
CartesianSeries<TItem>.Visible
CartesianSeries<TItem>.ShowInLegend
CartesianSeries<TItem>.ValueProperty
CartesianSeries<TItem>.RenderingOrder
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
public class RadzenPieSeries<TItem> : CartesianSeries<TItem>, IComponent, IHandleEvent, IHandleAfterRender, IChartSeries, IChartValueAxisSeries| Name | Description |
|---|---|
| TItem | The type of data items in the series. Each item represents one pie segment. |
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>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.
public RadzenPieSeries<TItem>()public string Color { get; }
| Type | Description |
|---|---|
| string |
public CoordinateSystem CoordinateSystem { get; }
| Type | Description |
|---|---|
| CoordinateSystem |
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.
public double CornerRadius { get; set; }
| Type | Description |
|---|---|
| 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. |
Returns the current radius - either a specified Radius or automatically calculated one.
protected double CurrentRadius { get; }
| Type | Description |
|---|---|
| double | Returns the current radius - either a specified Radius or automatically calculated one. |
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.
public double ExplodeOffset { get; set; }
| Type | Description |
|---|---|
| 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. |
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.
public string ExplodedProperty { get; set; }
| Type | Description |
|---|---|
| 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. |
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.
public FillMode FillMode { get; set; }
| Type | Description |
|---|---|
| FillMode | 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. |
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.
public IEnumerable<string> Fills { get; set; }
| 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. |
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.
public double GradientEndOpacity { get; set; }
| Type | Description |
|---|---|
| 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. |
Specifies the radius fraction (0-1) at which the gradient holds the full color before it starts to fade. Used when FillMode is Gradient.
public double GradientInnerOffset { get; set; }
| Type | Description |
|---|---|
| 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. |
Specifies the radius fraction (0-1) of the gradient's faded middle stop. Used when FillMode is Gradient.
public double GradientMidOffset { get; set; }
| Type | Description |
|---|---|
| double | Specifies the radius fraction (0-1) of the gradient's faded middle stop. Used when FillMode is Gradient. |
Specifies the opacity at the very rim of the gradient. Used when FillMode is Gradient.
public double GradientRimOpacity { get; set; }
| Type | Description |
|---|---|
| double | Specifies the opacity at the very rim of the gradient. Used when FillMode is Gradient. |
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.
public double GradientStartOpacity { get; set; }
| Type | Description |
|---|---|
| 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. |
Stores Data filtered to items greater than zero as an IList of TItem.
protected IList<TItem> PositiveItems { get; }
| Type | Description |
|---|---|
| IList<TItem> | Stores Data filtered to items greater than zero as an IList of TItem. |
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.
public double? Radius { get; set; }
| 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. |
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.
public string RadiusProperty { get; set; }
| Type | Description |
|---|---|
| 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. |
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.
public double SegmentGap { get; set; }
| Type | Description |
|---|---|
| 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. |
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.
public bool ShowTooltipOnLegend { get; set; }
| Type | Description |
|---|---|
| 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. |
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).
public double StartAngle { get; set; }
| Type | Description |
|---|---|
| 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). |
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.
public double StrokeWidth { get; set; }
| Type | Description |
|---|---|
| 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. |
Gets or sets a collection of stroke (border) colors applied to individual pie segments in sequence. Use with StrokeWidth to create visible segment borders.
public IEnumerable<string> Strokes { get; set; }
| 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. |
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).
public double TotalAngle { get; set; }
| Type | Description |
|---|---|
| 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). |
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.
public double? X { get; set; }
| 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. |
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.
public double? Y { get; set; }
| 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. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
public override bool Contains(double x, double y, double tolerance)
| Type | Name | Description |
|---|---|---|
| double | x | |
| double | y | |
| double | tolerance |
| Type | Description |
|---|---|
| bool |
public override ValueTuple<object, Point> DataAt(double x, double y)
| Type | Name | Description |
|---|---|---|
| double | x | |
| double | y |
| Type | Description |
|---|---|
| ValueTuple<object, Point> |
Converts degrees to radians.
protected double DegToRad(double degrees)
| Type | Name | Description |
|---|---|---|
| double | degrees |
| Type | Description |
|---|---|
| double |
public override IEnumerable<Rendering.ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
| Type | Name | Description |
|---|---|---|
| double | offsetX | |
| double | offsetY |
| Type | Description |
|---|---|
| IEnumerable<Rendering.ChartDataLabel> |
public override IEnumerable<Rendering.ChartDataLabel> GetDataLabels(double offsetX, double offsetY, DataLabelPosition position)
| Type | Name | Description |
|---|---|---|
| double | offsetX | |
| double | offsetY | |
| DataLabelPosition | position |
| Type | Description |
|---|---|
| IEnumerable<Rendering.ChartDataLabel> |
public override double MeasureLegend()
| Type | Description |
|---|---|
| double |
public override IEnumerable<double> MeasureLegendItems()
| Type | Description |
|---|---|
| IEnumerable<double> |
public override RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
| Type | Description |
|---|---|
| RenderFragment |
protected override RenderFragment RenderLegendItem(bool clickable)
| Type | Name | Description |
|---|---|---|
| bool | clickable |
| Type | Description |
|---|---|
| RenderFragment |
Creates SVG path that renders the specified segment, rounding its corners by CornerRadius.
protected string Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle)
| 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. |
| Type | Description |
|---|---|
| string |
Creates SVG path that renders the specified segment, rounding its corners by CornerRadius.
protected string Segment(double x, double y, double radius, double innerRadius, double startAngle, double endAngle, double cornerRadius)
| 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 |
| Type | Description |
|---|---|
| string |
Converts radial coordinates to to cartesian.
protected ValueTuple<double, double> ToCartesian(double x, double y, double radius, double degrees)
| Type | Name | Description |
|---|---|---|
| double | x | The x. |
| double | y | The y. |
| double | radius | The radius. |
| double | degrees | The degrees. |
| Type | Description |
|---|---|
| ValueTuple<double, double> |
protected override string TooltipClass(TItem item)
| Type | Name | Description |
|---|---|---|
| TItem | item |
| Type | Description |
|---|---|
| string |
protected override string TooltipStyle(TItem item)
| Type | Name | Description |
|---|---|---|
| TItem | item |
| Type | Description |
|---|---|
| string |