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.Charts
Assembly: Syncfusion.Maui.Charts.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 X1="1" Y1="10" X2="4" Y2="20" Text="Horizontal" ShowAxisLabel="True">
</chart:HorizontalLineAnnotation>
</chart:SfCartesianChart.Annotations>
Constructors
HorizontalLineAnnotation()
Declaration
public HorizontalLineAnnotation()
Fields
AxisLabelStyleProperty
Identifies the AxisLabelStyle bindable property.
Declaration
public static readonly BindableProperty AxisLabelStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for AxisLabelStyle bindable property. |
ShowAxisLabelProperty
Identifies the ShowAxisLabel bindable property.
Declaration
public static readonly BindableProperty ShowAxisLabelProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ShowAxisLabel bindable property. |
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 X1="1" Y1="10" X2="4" Y2="20">
<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 X1="1" Y1="10" X2="4" Y2="20" ShowAxisLabel="True"/>
</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()
Overrides
OnParentSet()
Declaration
protected override void OnParentSet()