Class ChartAnnotation
Annotation is a user defined HTML element that can be placed on chart We can use annotations to pile up the visual elegance of the chart. Specifies the customization of annotation.
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChartAnnotation : ChartSubComponent, ISubcomponentTracker, IChartElement
Constructors
ChartAnnotation()
Declaration
public ChartAnnotation()
Properties
ContentTemplate
Gets or sets the content template for the annotation.
Declaration
public RenderFragment ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | The template content is applied for the chart annotation based on the custom template provided by the user that is being rendered. The default value is null. |
Remarks
The ContentTemplate is used to define a custom template for the chart annotation.
Examples
<SfChart Title="Olympic Medals">
<ChartAnnotations>
<ChartAnnotation X="250" Y="100" CoordinateUnits="Units.Pixel">
<ContentTemplate>
<div>Annotation in Pixel</div>
</ContentTemplate>
</ChartAnnotation>
</ChartAnnotations>
...
</SfChart>
CoordinateUnits
Gets or sets the annotation’s coordinate units, either in Pixel or Point.
Declaration
public Units CoordinateUnits { get; set; }
Property Value
Type | Description |
---|---|
Units | One of the Units enumerations that specifies the coordinate units of an annotation. The options include:
|
Description
Gets or sets information about the annotation for assistive technology.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string providing additional details or context about the annotation that can be utilized by assistive technology. |
Region
Gets or sets the regions to insert annotations in relation to a series or a chart.
Declaration
public Regions Region { get; set; }
Property Value
Type | Description |
---|---|
Regions | One of the Regions enumerations that specifies the regions of an annotation. The options include:
|
RendererKey
Declaration
public string RendererKey { get; set; }
Property Value
Type |
---|
System.String |
RendererType
Declaration
public Type RendererType { get; set; }
Property Value
Type |
---|
System.Type |
X
Gets or sets the X-coordinate value for the annotation.
Declaration
public object X { get; set; }
Property Value
Type | Description |
---|---|
System.Object | If the coordinate unit is set to Point, this property specifies the axis value. Otherwise, it specifies the pixel or percentage of the coordinate. The default value is zero. |
XAxisName
Gets or sets the name of the horizontal axis associated with the annotation.
Declaration
public string XAxisName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the horizontal axis. |
Remarks
This property requires the presence of the 'Axes' of the chart.
Y
Gets or sets the Y-coordinate value for the annotation.
Declaration
public string Y { get; set; }
Property Value
Type | Description |
---|---|
System.String | If the coordinate unit is set to Point, this property specifies the axis value.
Otherwise, it specifies the pixel or percentage of the coordinate. |
YAxisName
Gets or sets the name of the vertical axis associated with the annotation.
Declaration
public string YAxisName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the vertical axis. |
Remarks
This property requires the presence of the 'Axes' of the chart.
Methods
OnInitialized()
Declaration
protected override void OnInitialized()
OnParametersSet()
Declaration
protected override void OnParametersSet()