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>.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>.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>.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| 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 CoordinateSystem CoordinateSystem { get; }
| Type | Description |
|---|---|
| CoordinateSystem |
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 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. |
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 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 double MeasureLegend()
| Type | Description |
|---|---|
| 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.
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 |
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 |