Skip to main content

ChartAnnotation Class

Definition

Assembly:Avalonia.Controls.Charts
Package:Avalonia.Controls.Charts

Base class for Cartesian chart annotations such as reference lines, bands, and text labels. Annotation coordinates are expressed in axis space and are converted to pixels by the shared Cartesian annotation rendering pipeline.

public class ChartAnnotation

Methods

NameDescription
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject.
ClearValue (4 overloads)Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
SetCurrentValue (2 overloads)Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject.
SetValue (3 overloads)Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

Properties

NameDescription
FontSizeGets or sets the font size used for annotation text or labels.
ForegroundGets or sets the brush used for annotation text or labels. When unset, text-capable annotations fall back to their local defaults or to Avalonia.Controls.Charts.ChartAnnotation.Stroke where appropriate.
IsBandAnnotationGets whether this annotation is a band annotation. Used by the rendering pipeline to distinguish bands from line/text annotations without requiring a cross-assembly type check.
IsVisibleGets or sets whether this annotation is visible.
OpacityGets or sets the opacity applied to the entire annotation.
StrokeGets or sets the stroke brush for annotation geometry. Text-based annotations can also use this as an outline brush.
StrokeThicknessGets or sets the stroke thickness for annotation geometry or text outlines.
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
ItemInherited from AvaloniaObject.

FontSize Property

Gets or sets the font size used for annotation text or labels.

public double FontSize { get; set; }

Foreground Property

Gets or sets the brush used for annotation text or labels. When unset, text-capable annotations fall back to their local defaults or to Avalonia.Controls.Charts.ChartAnnotation.Stroke where appropriate.

public Avalonia.Media.IBrush Foreground { get; set; }

IsBandAnnotation Property

Gets whether this annotation is a band annotation. Used by the rendering pipeline to distinguish bands from line/text annotations without requiring a cross-assembly type check.

public bool IsBandAnnotation { get; set; }

IsVisible Property

Gets or sets whether this annotation is visible.

public bool IsVisible { get; set; }

Opacity Property

Gets or sets the opacity applied to the entire annotation.

public double Opacity { get; set; }

Stroke Property

Gets or sets the stroke brush for annotation geometry. Text-based annotations can also use this as an outline brush.

public Avalonia.Media.IBrush Stroke { get; set; }

StrokeThickness Property

Gets or sets the stroke thickness for annotation geometry or text outlines.

public double StrokeThickness { get; set; }

Fields

FontSizeProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.FontSize Avalonia property.

public Avalonia.StyledProperty<double> FontSizeProperty

ForegroundProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.Foreground Avalonia property.

public Avalonia.StyledProperty<Avalonia.Media.IBrush> ForegroundProperty

IsVisibleProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.IsVisible Avalonia property.

public Avalonia.StyledProperty<bool> IsVisibleProperty

OpacityProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.Opacity Avalonia property.

public Avalonia.StyledProperty<double> OpacityProperty

StrokeProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.Stroke Avalonia property.

public Avalonia.StyledProperty<Avalonia.Media.IBrush> StrokeProperty

StrokeThicknessProperty Field

Identifies the Avalonia.Controls.Charts.ChartAnnotation.StrokeThickness Avalonia property.

public Avalonia.StyledProperty<double> StrokeThicknessProperty

Events

NameDescription
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.