RadzenSeriesDataLabels Class

Displays the series values as text labels.

Inheritance

Object

ComponentBase

RadzenChartComponentBase

RadzenSeriesDataLabels

Implements

IComponent

IHandleEvent

IHandleAfterRender

IChartSeriesOverlay

Inherited Members

RadzenChartComponentBase.Initialize

RadzenChartComponentBase.SetParametersAsync

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 RadzenSeriesDataLabels : RadzenChartComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IChartSeriesOverlay

Examples

<RadzenChart>
    <RadzenLineSeries Data=@revenue CategoryProperty="Quarter" ValueProperty="Revenue">
       <RadzenSeriesDataLabels />
    </RadzenLineSeries>
</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 }
    };
}

Constructors

RadzenSeriesDataLabelsLink to this section

Displays the series values as text labels.

Declaration
public RadzenSeriesDataLabels()

Properties

AllowOverlapLink to this section

Gets or sets a value indicating whether overlapping labels are allowed. When false (default), labels which would overlap an already rendered label - including labels of other series - are hidden.

Declaration
public bool AllowOverlap { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether overlapping labels are allowed. When false (default), labels which would overlap an already rendered label - including labels of other series - are hidden.

AppearanceLink to this section

Gets or sets the visual treatment of the labels: a rounded background chip (default), an outlined text halo, or plain text.

Declaration
public DataLabelAppearance Appearance { get; set; }
Property Value
Type Description
DataLabelAppearanceGets or sets the visual treatment of the labels: a rounded background chip (default), an outlined text halo, or plain text.

DisplayLink to this section

Gets or sets which data points display labels.

Declaration
public DataLabelDisplay Display { get; set; }
Property Value
Type Description
DataLabelDisplayGets or sets which data points display labels.

FillLink to this section

Defines the fill color of the component.

Declaration
public string Fill { get; set; }
Property Value
Type Description
stringDefines the fill color of the component.

FormatStringLink to this section

Gets or sets a format string applied to the data point value (e.g. {0:C0}). Overrides the value axis format. Formatter takes precedence when both are set.

Declaration
public string FormatString { get; set; }
Property Value
Type Description
stringGets or sets a format string applied to the data point value (e.g. {0:C0}). Overrides the value axis format. Formatter takes precedence when both are set.

FormatterLink to this section

Gets or sets a callback which converts the data point value to the label text. Takes precedence over FormatString and the axis format.

Declaration
public Func<object, string> Formatter { get; set; }
Property Value
Type Description
Func<object, string>Gets or sets a callback which converts the data point value to the label text. Takes precedence over FormatString and the axis format.

OffsetXLink to this section

Horizontal offset from the default position.

Declaration
public double OffsetX { get; set; }
Property Value
Type Description
doubleHorizontal offset from the default position.

OffsetYLink to this section

Vertical offset from the default position.

Declaration
public double OffsetY { get; set; }
Property Value
Type Description
doubleVertical offset from the default position.

PositionLink to this section

Gets or sets where labels render relative to their data point. Auto (default) uses the position best suited for the series type and flips labels which would clip the plot edge.

Declaration
public DataLabelPosition Position { get; set; }
Property Value
Type Description
DataLabelPositionGets or sets where labels render relative to their data point. Auto (default) uses the position best suited for the series type and flips labels which would clip the plot edge.

RenderOnTopLink to this section

Data labels render above all series so no series line draws over them.

Declaration
public bool RenderOnTop { get; }
Property Value
Type Description
boolData labels render above all series so no series line draws over them.

SeriesLink to this section

Declaration
protected IChartSeries Series { get; set; }
Property Value
Type Description
IChartSeries

StepLink to this section

Gets or sets the interval between labeled data points - 2 labels every other point, 3 every third.

Declaration
public int Step { get; set; }
Property Value
Type Description
intGets or sets the interval between labeled data points - 2 labels every other point, 3 every third.

VisibleLink to this section

Determines the visibility of the data labels. Set to true by default.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
boolDetermines the visibility of the data labels. Set to true by default.

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 bool Contains(double mouseX, double mouseY, int tolerance)
Parameters
Type Name Description
double mouseX
double mouseY
int tolerance
Returns
Type Description
bool

DisposeLink to this section

Declaration
public void Dispose()

GetSeriesDataLabelClassLink to this section

Gets the CSS class for the data labels.

Declaration
public string GetSeriesDataLabelClass()
Returns
Type Description
string

GetTooltipPositionLink to this section

Declaration
public Point GetTooltipPosition(double mouseX, double mouseY)
Parameters
Type Name Description
double mouseX
double mouseY
Returns
Type Description
Point

RenderLink to this section

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

RenderTooltipLink to this section

Declaration
public RenderFragment RenderTooltip(double mouseX, double mouseY)
Parameters
Type Name Description
double mouseX
double mouseY
Returns
Type Description
RenderFragment

ShouldRefreshChartLink to this section

Declaration
protected override bool ShouldRefreshChart(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
bool
An error has occurred. This app may no longer respond until reloaded. Reload 🗙