Skip to content
ChartForgeX
Class

ChartAnnotation

ChartForgeX.Core

Namespace
ChartForgeX.Core
Assembly
ChartForgeX
Modifiers
sealed

Represents fixed chart annotation geometry and identity with optional mutable authoring stroke styling.

Inheritance

  • object
  • ChartAnnotation

Usage

Explore 16 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 8

Constructors

ChartAnnotation 2 overloads
public ChartAnnotation(ChartAnnotationKind kind, double value, double? endValue, string label, ChartColor color, double opacity, bool showLabel = true) #

Initializes a new instance of the ChartAnnotation class.

Parameters

kind ChartForgeX.Core.ChartAnnotationKind required
The annotation kind.
value double required
The first annotation value.
endValue double? required
The second annotation value for bands.
label string required
The annotation label.
color ChartForgeX.Primitives.ChartColor required
The annotation color.
opacity double required
The annotation opacity used for band fills.
showLabel bool = true optional
Whether to paint the label. False retains its accessible and semantic content.
public ChartAnnotation(ChartAnnotationId id, ChartAnnotationKind kind, double value, double? endValue, string label, ChartColor color, double opacity, bool showLabel = true) #

Creates an annotation whose identity survives source replacement and collection reordering.

Parameters

id ChartForgeX.Core.ChartAnnotationId required
The authored identity, unique among annotations within one chart.
kind ChartForgeX.Core.ChartAnnotationKind required
The annotation kind.
value double required
The first annotation value.
endValue double? required
The second annotation value for bands.
label string required
The annotation caption, independent of its identity.
color ChartForgeX.Primitives.ChartColor required
The annotation color.
opacity double required
The band fill opacity.
showLabel bool = true optional
Whether to paint the caption while retaining its semantic content.

Methods

public static ChartAnnotation LineSegment(ChartPoint start, ChartPoint end, string label, ChartColor color, ChartAnnotationId? id = null, ChartAxisSide yAxis = Primary, bool showLabel = true) #

Creates a finite Cartesian source line, clipped to the plot without changing source endpoints or axis bounds.

Parameters

start ChartForgeX.Primitives.ChartPoint required
end ChartForgeX.Primitives.ChartPoint required
label string required
color ChartForgeX.Primitives.ChartColor required
id ChartForgeX.Core.ChartAnnotationId? = null optional
yAxis ChartForgeX.Core.ChartAxisSide = Primary optional
showLabel bool = true optional
public static ChartAnnotation Note(ChartPoint anchor, string label, ChartColor color, ChartAnnotationId? id = null, ChartAxisSide yAxis = Primary, bool showLabel = true) #

Creates a Cartesian note anchored to exact source coordinates without expanding the data domain.

Parameters

anchor ChartForgeX.Primitives.ChartPoint required
label string required
color ChartForgeX.Primitives.ChartColor required
id ChartForgeX.Core.ChartAnnotationId? = null optional
yAxis ChartForgeX.Core.ChartAxisSide = Primary optional
showLabel bool = true optional
public static ChartAnnotation ParallelChannel(ChartPoint start, ChartPoint end, double yOffset, string label, ChartColor color, ChartAnnotationId? id = null, ChartAxisSide yAxis = Primary, double opacity = 0.14, bool showLabel = true) #

Creates two source-coordinate boundaries separated by a signed Y offset, with translucent fill between them.

Parameters

start ChartForgeX.Primitives.ChartPoint required
end ChartForgeX.Primitives.ChartPoint required
yOffset double required
label string required
color ChartForgeX.Primitives.ChartColor required
id ChartForgeX.Core.ChartAnnotationId? = null optional
yAxis ChartForgeX.Core.ChartAxisSide = Primary optional
opacity double = 0.14 optional
showLabel bool = true optional

Properties

public ChartAnnotationId? Id { get; } #

Gets the authored source identity, or null for an anonymous annotation local to the current chart source.

public ChartAnnotationKind Kind { get; } #

Gets the annotation kind.

public double Value { get; } #

Gets the first annotation value.

public double? EndValue { get; } #

Gets the second annotation value for band annotations.

public string Label { get; } #

Gets the annotation label.

public bool ShowLabel { get; } #

Gets whether the label is painted beside the annotation. A hidden label remains available in accessible descriptions and exported semantic metadata.

public ChartColor Color { get; } #

Gets the annotation color.

public double Opacity { get; } #

Gets the annotation opacity used for band fills.

public ChartStrokeStyle? StrokeStyle { get; set; } #

Gets or sets optional reference-line stroke overrides used by the next preparation. Band fills retain their own color and opacity.

public ChartAxisSide ValueAxis { get; set; } #

Gets or sets the value axis that positions a horizontal reference line or band.

public ChartPoint? SourceStart { get; } #

Gets the source anchor of a note, line segment or channel; axis-spanning guides return null.

public ChartPoint? SourceEnd { get; } #

Gets the second source endpoint of a line segment or channel; notes and axis-spanning guides return null.

public double ChannelOffset { get; } #

Gets the channel's signed offset in source Y units; other annotations return zero.

public ChartAxisSide SourceYAxis { get; } #

Gets the value axis owning source-coordinate Y values. Axis-spanning guides retain their existing physical-axis semantics.

Extension Methods

public static ChartAnnotation StrokeStyle(ChartAnnotation chartAnnotation, ChartStrokeStyle? value) #

Sets ChartAnnotation.StrokeStyle: Gets or sets optional reference-line stroke overrides used by the next preparation. Band fills retain their own color and opacity.

Parameters

chartAnnotation ChartForgeX.Core.ChartAnnotation required
The instance.
value ChartForgeX.Core.ChartStrokeStyle? required
The value.

Returns

ChartAnnotation The same instance.

Examples

// C# initializer or property           // C# fluent
chartAnnotation.StrokeStyle = value;    chartAnnotation.StrokeStyle(value);
public static ChartAnnotation ValueAxis(ChartAnnotation chartAnnotation, ChartAxisSide value) #

Sets ChartAnnotation.ValueAxis: Gets or sets the value axis that positions a horizontal reference line or band.

Parameters

chartAnnotation ChartForgeX.Core.ChartAnnotation required
The instance.
value ChartForgeX.Core.ChartAxisSide required
The value.

Returns

ChartAnnotation The same instance.

Examples

// C# initializer or property         // C# fluent
chartAnnotation.ValueAxis = value;    chartAnnotation.ValueAxis(value);