Class LineAnnotation
This class is used to add a line annotation to the SfCartesianChart. An instance of this class needs to be added to the Annotations collection.
Inheritance
System.Object
LineAnnotation
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class LineAnnotation : ShapeAnnotation, IThemeElement
Remarks
LineAnnotation is used to draw a line across the chart area.
Examples
<chart:SfCartesianChart.Annotations>
<chart:LineAnnotation X1="1" Y1="10" X2="4" Y2="20" Text="Line" CoordinateUnit="Axis">
</chart:LineAnnotation>
</chart:SfCartesianChart.Annotations>
Constructors
LineAnnotation()
Initializes a new instance of the LineAnnotation.
Declaration
public LineAnnotation()
Fields
LineCapProperty
Identifies the LineCap bindable property.
Declaration
public static readonly BindableProperty LineCapProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the LineCap bindable property determines the style of the line cap for the ChartAnnotation.
Properties
LineCap
Represents the type of cap for line annotation. Gets or sets the line cap value for the line annotation.
Declaration
public ChartLineCap LineCap { get; set; }
Property Value
Type | Description |
---|---|
ChartLineCap | This property takes the ChartLineCap as its value and its default value is None. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Annotations>
<chart:LineAnnotation X1="0" Y1="10" X2="4" Y2="50" LineCap="Arrow"/>
</chart:SfCartesianChart.Annotations>
</chart:SfCartesianChart>
Methods
Draw(ICanvas, RectF)
Draws the annotation of the chart.
Declaration
protected override void Draw(ICanvas canvas, RectF dirtyRect)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas | |
Microsoft.Maui.Graphics.RectF | dirtyRect |