A versatile chart component for visualizing data through various chart types including line, area, column, bar, pie, and donut series. RadzenChart supports multiple series, customizable axes, legends, tooltips, data labels, markers, and interactive features. Container for one or more chart series components. Each series (RadzenLineSeries, RadzenColumnSeries, RadzenAreaSeries, etc.) defines how data is visualized. Supports Cartesian charts (Line, Area, Column, Bar, StackedColumn, StackedBar, StackedArea with X/Y axes), Pie charts (Pie and Donut series for showing proportions), customization of color schemes/axis configuration/grid lines/legends/tooltips/data labels/markers, interactive click events on series and legend items with hover tooltips, annotations including trend lines/mean/median/mode lines/value annotations, and responsive design that automatically adapts to container size. Series are defined as child components within the RadzenChart. Configure axes using RadzenCategoryAxis and RadzenValueAxis, customize the legend with RadzenLegend, and add tooltips with RadzenChartTooltipOptions.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenChart : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderBasic column chart:
<RadzenChart>
<RadzenColumnSeries Data=@revenue CategoryProperty="Quarter" Title="Revenue" ValueProperty="Revenue" />
</RadzenChart>
@code {
class DataItem
{
public string Quarter { get; set; }
public double Revenue { get; set; }
}
DataItem[] revenue = new DataItem[]
{
new DataItem { Quarter = "Q1", Revenue = 234000 },
new DataItem { Quarter = "Q2", Revenue = 284000 },
new DataItem { Quarter = "Q3", Revenue = 274000 },
new DataItem { Quarter = "Q4", Revenue = 294000 }
};
}
Chart with multiple series and custom legend:
<RadzenChart>
<RadzenLineSeries Data=@sales2023 CategoryProperty="Month" ValueProperty="Amount" Title="2023 Sales" />
<RadzenLineSeries Data=@sales2024 CategoryProperty="Month" ValueProperty="Amount" Title="2024 Sales" />
<RadzenLegend Position="LegendPosition.Bottom" />
<RadzenCategoryAxis Formatter="@(value => value.ToString())" />
<RadzenValueAxis Formatter="@(value => value.ToString("C"))" />
</RadzenChart>A versatile chart component for visualizing data through various chart types including line, area, column, bar, pie, and donut series. RadzenChart supports multiple series, customizable axes, legends, tooltips, data labels, markers, and interactive features. Container for one or more chart series components. Each series (RadzenLineSeries, RadzenColumnSeries, RadzenAreaSeries, etc.) defines how data is visualized. Supports Cartesian charts (Line, Area, Column, Bar, StackedColumn, StackedBar, StackedArea with X/Y axes), Pie charts (Pie and Donut series for showing proportions), customization of color schemes/axis configuration/grid lines/legends/tooltips/data labels/markers, interactive click events on series and legend items with hover tooltips, annotations including trend lines/mean/median/mode lines/value annotations, and responsive design that automatically adapts to container size. Series are defined as child components within the RadzenChart. Configure axes using RadzenCategoryAxis and RadzenValueAxis, customize the legend with RadzenLegend, and add tooltips with RadzenChartTooltipOptions.
public RadzenChart()Gets or sets the child content. Used to specify series and other configuration.
public RenderFragment ChildContent { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the child content. Used to specify series and other configuration. |
The minimum pixel distance from a data point to the mouse cursor required for the SeriesClick event to fire. Set to 25 by default.
public int ClickTolerance { get; set; }
| Type | Description |
|---|---|
| int | The minimum pixel distance from a data point to the mouse cursor required for the SeriesClick event to fire. Set to 25 by default. |
Gets or sets the color scheme used to assign colors to chart series. Determines the palette of colors applied sequentially to each series when series-specific colors are not set. Available schemes include Pastel (default), Palette, Monochrome, and custom color schemes.
public ColorScheme ColorScheme { get; set; }
| Type | Description |
|---|---|
| ColorScheme | Gets or sets the color scheme used to assign colors to chart series. Determines the palette of colors applied sequentially to each series when series-specific colors are not set. Available schemes include Pastel (default), Palette, Monochrome, and custom color schemes. |
Gets the runtime height of the chart.
protected double? Height { get; set; }
| Type | Description |
|---|---|
| double? | Gets the runtime height of the chart. |
Gets or sets the callback invoked when a user clicks on a legend item. Useful for implementing custom behaviors like toggling series visibility or filtering data.
public EventCallback<LegendClickEventArgs> LegendClick { get; set; }
| Type | Description |
|---|---|
| EventCallback<LegendClickEventArgs> | Gets or sets the callback invoked when a user clicks on a legend item. Useful for implementing custom behaviors like toggling series visibility or filtering data. |
Gets or sets the bottom margin of the plot area.
protected double MarginBottom { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the bottom margin of the plot area. |
Gets or sets the left margin of the plot area.
protected double MarginLeft { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the left margin of the plot area. |
Gets or sets the right margin of the plot area.
protected double MarginRight { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the right margin of the plot area. |
Gets or sets the top margin of the plot area.
protected double MarginTop { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the top margin of the plot area. |
Gets or sets the callback invoked when a user clicks on a data point or segment in a chart series. Provides information about the clicked series, data item, and value in the event arguments.
public EventCallback<SeriesClickEventArgs> SeriesClick { get; set; }
| Type | Description |
|---|---|
| EventCallback<SeriesClickEventArgs> | Gets or sets the callback invoked when a user clicks on a data point or segment in a chart series. Provides information about the clicked series, data item, and value in the event arguments. |
The minimum pixel distance from a data point to the mouse cursor required by the tooltip to show. Set to 25 by default.
public int TooltipTolerance { get; set; }
| Type | Description |
|---|---|
| int | The minimum pixel distance from a data point to the mouse cursor required by the tooltip to show. Set to 25 by default. |
Gets the runtime width of the chart.
protected double? Width { get; set; }
| Type | Description |
|---|---|
| double? | Gets the runtime width of the chart. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
Invoked via interop when the user clicks the RadzenChart. Raises the SeriesClick handler.
public Task Click(double x, double y)
| Type | Name | Description |
|---|---|---|
| double | x | The x. |
| double | y | The y. |
| Type | Description |
|---|---|
| Task |
Displays a Tooltip on a chart without user interaction, given a series, and the data associated with it.
public Task DisplayTooltipFor(IChartSeries series, object data)
| Type | Name | Description |
|---|---|---|
| IChartSeries | series | |
| object | data |
| Type | Description |
|---|---|
| Task |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Returns the Series used by the Chart.
public IReadOnlyList<IChartSeries> GetSeries()
| Type | Description |
|---|---|
| IReadOnlyList<IChartSeries> |
Invoked via interop when the user moves the mouse over the RadzenChart. Displays the tooltip.
public Task MouseMove(double x, double y)
| Type | Name | Description |
|---|---|---|
| double | x | The x. |
| double | y | The y. |
| Type | Description |
|---|---|
| Task |
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Causes all series to refresh. Use it when Data has changed.
public Task Reload()
| Type | Description |
|---|---|
| Task |
Invoked via interop when the RadzenChart resizes. Display the series with the new dimensions.
public Task Resize(double width, double height)
| Type | Name | Description |
|---|---|---|
| double | width | The width. |
| double | height | The height. |
| Type | Description |
|---|---|
| Task |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |
Returns whether the chart should render axes.
protected bool ShouldRenderAxes()
| Type | Description |
|---|---|
| bool |
Updates the scales based on the configuration.
protected virtual bool UpdateScales()
| Type | Description |
|---|---|
| bool |