Class TextAnnotation
This class is used to add a text annotation to the SfCartesianChart. An instance of this class needs to be added to the Annotations collection.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class TextAnnotation : ChartAnnotation, IThemeElement
Remarks
Text annotations are used to add simple text at specific points over the chart area.
Examples
<chart:SfCartesianChart.Annotations>
<chart:TextAnnotation X1="3" Y1="10" Text="TextAnnotation">
</chart:TextAnnotation>
</chart:SfCartesianChart.Annotations>
Constructors
TextAnnotation()
Declaration
public TextAnnotation()
Fields
LabelStyleProperty
Identifies the LabelStyle bindable property.
Declaration
public static readonly BindableProperty LabelStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LabelStyle bindable property. |
TextProperty
Identifies the Text bindable property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Text bindable property. |
Properties
LabelStyle
Get or set the value to customize the appearance of annotation text.
Declaration
public ChartAnnotationLabelStyle LabelStyle { get; set; }
Property Value
Type | Description |
---|---|
ChartAnnotationLabelStyle | This property takes the ChartAnnotationLabelStyle as its value. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Annotations>
<chart:TextAnnotation X1="3" Y1="30" Text="TextAnnotation">
<chart:TextAnnotation.LabelStyle>
<chart:ChartAnnotationLabelStyle HorizontalTextAlignment="Start" VerticalTextAlignment="Start"/>
</chart:TextAnnotation.LabelStyle>
</chart:TextAnnotation>
</chart:SfCartesianChart.Annotations>
</chart:SfCartesianChart>
Text
Gets or sets the text to be displayed on the annotation.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Annotations>
<chart:TextAnnotation X1="3" Y1="30" Text="TextAnnotation">
</chart:HorizontalLineAnnotation>
</chart:SfCartesianChart.Annotations>
</chart:SfCartesianChart>
Methods
Draw(ICanvas, RectF)
Declaration
protected override void Draw(ICanvas canvas, RectF dirtyRect)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas | |
Microsoft.Maui.Graphics.RectF | dirtyRect |
Overrides
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()
OnParentSet()
Declaration
protected override void OnParentSet()