Displays the series values as text labels.
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
public class RadzenSeriesDataLabels : RadzenChartComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IChartSeriesOverlay<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 }
};
}Displays the series values as text labels.
public RadzenSeriesDataLabels()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.
public bool AllowOverlap { get; set; }
| Type | Description |
|---|---|
| bool | 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. |
Gets or sets the visual treatment of the labels: a rounded background chip (default), an outlined text halo, or plain text.
public DataLabelAppearance Appearance { get; set; }
| Type | Description |
|---|---|
| DataLabelAppearance | Gets or sets the visual treatment of the labels: a rounded background chip (default), an outlined text halo, or plain text. |
Gets or sets which data points display labels.
public DataLabelDisplay Display { get; set; }
| Type | Description |
|---|---|
| DataLabelDisplay | Gets or sets which data points display labels. |
Defines the fill color of the component.
public string Fill { get; set; }
| Type | Description |
|---|---|
| string | Defines the fill color of the component. |
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.
public string FormatString { get; set; }
| Type | Description |
|---|---|
| string | 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. |
Gets or sets a callback which converts the data point value to the label text. Takes precedence over FormatString and the axis format.
public Func<object, string> Formatter { get; set; }
| 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. |
Horizontal offset from the default position.
public double OffsetX { get; set; }
| Type | Description |
|---|---|
| double | Horizontal offset from the default position. |
Vertical offset from the default position.
public double OffsetY { get; set; }
| Type | Description |
|---|---|
| double | Vertical offset from the default position. |
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.
public DataLabelPosition Position { get; set; }
| Type | Description |
|---|---|
| DataLabelPosition | 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. |
Data labels render above all series so no series line draws over them.
public bool RenderOnTop { get; }
| Type | Description |
|---|---|
| bool | Data labels render above all series so no series line draws over them. |
protected IChartSeries Series { get; set; }
| Type | Description |
|---|---|
| IChartSeries |
Gets or sets the interval between labeled data points - 2 labels every other point, 3 every third.
public int Step { get; set; }
| Type | Description |
|---|---|
| int | Gets or sets the interval between labeled data points - 2 labels every other point, 3 every third. |
Determines the visibility of the data labels. Set to true by default.
public bool Visible { get; set; }
| Type | Description |
|---|---|
| bool | Determines the visibility of the data labels. Set to true by default. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
public bool Contains(double mouseX, double mouseY, int tolerance)
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY | |
| int | tolerance |
| Type | Description |
|---|---|
| bool |
Gets the CSS class for the data labels.
public string GetSeriesDataLabelClass()
| Type | Description |
|---|---|
| string |
public Point GetTooltipPosition(double mouseX, double mouseY)
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY |
| Type | Description |
|---|---|
| Point |
public RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
| Type | Description |
|---|---|
| RenderFragment |
public RenderFragment RenderTooltip(double mouseX, double mouseY)
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY |
| Type | Description |
|---|---|
| RenderFragment |
protected override bool ShouldRefreshChart(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| bool |