Class RadzenSeriesAnnotation<TItem>
Displays a text label for the specified data item from the series.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenSeriesAnnotation<TItem> : RadzenChartComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IChartSeriesOverlay, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TItem |
Examples
<RadzenChart>
<RadzenLineSeries Data=@revenue CategoryProperty="Quarter" ValueProperty="Revenue">
<RadzenSeriesAnnotation Data="@revenue[1] Text="Q2 Revenue" />
</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
RadzenSeriesAnnotation()
Displays a text label for the specified data item from the series.
Declaration
public RadzenSeriesAnnotation()
Examples
<RadzenChart>
<RadzenLineSeries Data=@revenue CategoryProperty="Quarter" ValueProperty="Revenue">
<RadzenSeriesAnnotation Data="@revenue[1] Text="Q2 Revenue" />
</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 }
};
}
Properties
Data
The data item from the series this annotation applies to.
Declaration
[Parameter]
public TItem Data { get; set; }
Property Value
| Type | Description |
|---|---|
| TItem |
Fill
The color of the annotation text.
Declaration
[Parameter]
public string Fill { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
OffsetX
Horizontal offset from the default position.
Declaration
[Parameter]
public double OffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
OffsetY
Vertical offset from the default position.
Declaration
[Parameter]
public double OffsetY { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Series
The series this annotation applies to. Set to true by default.
Declaration
[CascadingParameter]
protected CartesianSeries<TItem> Series { get; set; }
Property Value
| Type | Description |
|---|---|
| CartesianSeries<TItem> |
Text
The text to display in the annotation.
Declaration
[Parameter]
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Visible
Determines whether the annotation is visible. Set to true by default.
Declaration
[Parameter]
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Contains(double, double, int)
Hit test
Declaration
public bool Contains(double mouseX, double mouseY, int tolerance)
Parameters
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY | |
| int | tolerance |
Returns
| Type | Description |
|---|---|
| bool |
Dispose()
Displays a text label for the specified data item from the series.
Declaration
public void Dispose()
GetTooltipPosition(double, double)
Get position of the overlay tooltip.
Declaration
public Point GetTooltipPosition(double mouseX, double mouseY)
Parameters
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY |
Returns
| Type | Description |
|---|---|
| Point | Position. |
Render(ScaleBase, ScaleBase)
Render overlay
Declaration
public RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
Parameters
| Type | Name | Description |
|---|---|---|
| ScaleBase | categoryScale | |
| ScaleBase | valueScale |
Returns
| Type | Description |
|---|---|
| RenderFragment | RenderFragment |
RenderTooltip(double, double)
Renders tooltip
Declaration
public RenderFragment RenderTooltip(double mouseX, double mouseY)
Parameters
| Type | Name | Description |
|---|---|---|
| double | mouseX | |
| double | mouseY |
Returns
| Type | Description |
|---|---|
| RenderFragment |
ShouldRefreshChart(ParameterView)
Determines if RadzenChart should render.
Declaration
protected override bool ShouldRefreshChart(ParameterView parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters | The parameters. |
Returns
| Type | Description |
|---|---|
| bool |