Class HorizontalLineAnnotation
This class is used to add a horizontal line annotation to the SfCartesianChart. An instance of this class needs to be added to the Annotations collection.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class HorizontalLineAnnotation : LineAnnotation, IThemeElement
Remarks
HorizontalLineAnnotation is used to draw a horizontal line across the chart area.
Examples
<chart:SfCartesianChart.Annotations>
<chart:HorizontalLineAnnotation Y1="10" Text="Horizontal" ShowAxisLabel="True">
</chart:HorizontalLineAnnotation>
</chart:SfCartesianChart.Annotations>
Constructors
HorizontalLineAnnotation()
Initializes a new instance of the HorizontalLineAnnotation.
Declaration
public HorizontalLineAnnotation()
Fields
AxisLabelStyleProperty
Identifies the AxisLabelStyle bindable property.
Declaration
public static readonly BindableProperty AxisLabelStyleProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The AxisLabelStyle property allows customization of the axis label in the HorizontalLineAnnotation.
ShowAxisLabelProperty
Identifies the ShowAxisLabel bindable property.
Declaration
public static readonly BindableProperty ShowAxisLabelProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The ShowAxisLabel property determines whether the axis label is visible for the HorizontalLineAnnotation.
Properties
AxisLabelStyle
Gets or sets the customized style for the annotation axis label.
Declaration
public ChartLabelStyle AxisLabelStyle { get; set; }
Property Value
Type | Description |
---|---|
ChartLabelStyle | This property takes the ChartLabelStyle as its value. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Annotations>
<chart:HorizontalLineAnnotation Y1="10" >
<chart:HorizontalLineAnnotation.AxisLabelStyle>
<chart:ChartLabelStyle Background="Yellow"/>
</chart:HorizontalLineAnnotation.AxisLabelStyle>
</chart:HorizontalLineAnnotation>
</chart:SfCartesianChart.Annotations>
</chart:SfCartesianChart>
ShowAxisLabel
Gets or sets a value indicating whether to enable or disable the display of the annotation label on the axis.
Declaration
public bool ShowAxisLabel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Annotations>
<chart:HorizontalLineAnnotation Y1="10" ShowAxisLabel="True"/>
</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 |