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.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.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 |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The HorizontalAlignment property specifies how the custom view is horizontally aligned within the chart.
VerticalAlignmentProperty
Identifies the VerticalAlignment bindable property.
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The VerticalAlignment property specifies how the custom view is vertically aligned within the chart.
ViewProperty
Identifies the View bindable property.
Declaration
public static readonly BindableProperty ViewProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The View property defines the custom view to be displayed within the ViewAnnotation.
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>