Class ViewAnnotation
This class is used to add an view annotation in SfCartesianChart.An instance of this class need to be added to Annotations collection.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class ViewAnnotation : ChartAnnotation
Remarks
ViewAnnotation is used to add any custom shape or custom view over the chart area.
Examples
<chart:SfCartesianChart.Annotations>
<chart:ViewAnnotation X1="3" Y1="10">
<chart:ViewAnnotation.View>
<Label Text = "ViewAnnotation"/>
</chart:ViewAnnotation.View>
</chart:ViewAnnotation>
</chart:SfCartesianChart.Annotations>
Constructors
ViewAnnotation()
Declaration
public ViewAnnotation()
Fields
HorizontalAlignmentProperty
Identifies the HorizontalAlignment bindable property.
Declaration
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for HorizontalAlignment bindable property. |
VerticalAlignmentProperty
Identifies the VerticalAlignment bindable property.
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for VerticalAlignment bindable property. |
ViewProperty
Identifies the View bindable property.
Declaration
public static readonly BindableProperty ViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for View bindable property. |
Properties
HorizontalAlignment
Gets or sets the horizontal alignment of the view.
Declaration
public ChartAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
ChartAlignment | This property takes the ChartAlignment as its value and its default value is Center. |
Examples
<chart:SfCartesianChart.Annotations>
<chart:ViewAnnotation X1="3" Y1="10" HorizontalAlignment="Start">
<chart:ViewAnnotation.View>
<Label Text = "ViewAnnotation"/>
</chart:ViewAnnotation.View>
</chart:ViewAnnotation>
</chart:SfCartesianChart.Annotations>
VerticalAlignment
Gets or sets the vertical alignment of the view.
Declaration
public ChartAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
ChartAlignment | This property takes the ChartAlignment as its value and its default value is Center. |
Examples
<chart:SfCartesianChart.Annotations>
<chart:ViewAnnotation X1="3" Y1="10" VerticalAlignment="Start">
<chart:ViewAnnotation.View>
<Label Text = "ViewAnnotation"/>
</chart:ViewAnnotation.View>
</chart:ViewAnnotation>
</chart:SfCartesianChart.Annotations>
View
Gets or sets the View that represents custom view for annotation
Declaration
public View View { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | This property takes the Microsoft.Maui.Controls.View as its value and its default value is null |
Examples
<chart:SfCartesianChart.Annotations>
<chart:ViewAnnotation X1="3" Y1="10">
<chart:ViewAnnotation.View>
<Label Text = "ViewAnnotation"/>
</chart:ViewAnnotation.View>
</chart:ViewAnnotation>
</chart:SfCartesianChart.Annotations>
Methods
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()