# ChartAnnotation

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

 Class  

`ChartForgeX.Core`

**Namespace**

`ChartForgeX.Core`

**Assembly**

`ChartForgeX`

**Source**

[ChartAnnotation.cs:88](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L88)

**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.

### Returned or exposed by 8

- Property [Chart.Annotations](/api/chartforgex-core-chart/#property-annotations)
- Extension method [ChartAnnotation.StrokeStyle](/api/chartforgex-core-chartannotation/#extension-strokestyle-chartforgex-core-chartannotation-chartforgex-core-chartstrokestyle)
- Extension method [ChartAnnotation.ValueAxis](/api/chartforgex-core-chartannotation/#extension-valueaxis-chartforgex-core-chartannotation-chartforgex-core-chartaxisside)
- Method [ChartAnnotation.LineSegment](/api/chartforgex-core-chartannotation/#method-linesegment-chartforgex-primitives-chartpoint-chartforgex-primitives-chartpoint-string-chartforgex-primitives-chartcolor-nullable-chartforgex-core-chartannotationid-chartforgex-core-chartaxisside-boolean)
- Method [ChartAnnotation.Note](/api/chartforgex-core-chartannotation/#method-note-chartforgex-primitives-chartpoint-string-chartforgex-primitives-chartcolor-nullable-chartforgex-core-chartannotationid-chartforgex-core-chartaxisside-boolean)
- Method [ChartAnnotation.ParallelChannel](/api/chartforgex-core-chartannotation/#method-parallelchannel-chartforgex-primitives-chartpoint-chartforgex-primitives-chartpoint-double-string-chartforgex-primitives-chartcolor-nullable-chartforgex-core-chartannotationid-chartforgex-core-chartaxisside-double-boolean)
- Method [ChartAnnotationFluent.StrokeStyle](/api/chartforgex-core-chartannotationfluent/#method-strokestyle-chartforgex-core-chartannotation-chartforgex-core-chartstrokestyle)
- Method [ChartAnnotationFluent.ValueAxis](/api/chartforgex-core-chartannotationfluent/#method-valueaxis-chartforgex-core-chartannotation-chartforgex-core-chartaxisside)

### Accepted by parameters 8

- Method [Chart.AddAnnotation](/api/chartforgex-core-chart/#method-addannotation-chartforgex-core-chartannotation) parameter `annotation`
- Method [Chart.RemoveAnnotation](/api/chartforgex-core-chart/#method-removeannotation-chartforgex-core-chartannotation) parameter `annotation`
- Method [Chart.ReplaceAnnotation](/api/chartforgex-core-chart/#method-replaceannotation-chartforgex-core-chartannotation-chartforgex-core-chartannotation) parameter `existing`
- Method [Chart.ReplaceAnnotation](/api/chartforgex-core-chart/#method-replaceannotation-chartforgex-core-chartannotation) parameter `replacement`
- Extension method [ChartAnnotation.StrokeStyle](/api/chartforgex-core-chartannotation/#extension-strokestyle-chartforgex-core-chartannotation-chartforgex-core-chartstrokestyle) parameter `chartAnnotation`
- Extension method [ChartAnnotation.ValueAxis](/api/chartforgex-core-chartannotation/#extension-valueaxis-chartforgex-core-chartannotation-chartforgex-core-chartaxisside) parameter `chartAnnotation`
- Method [ChartAnnotationFluent.StrokeStyle](/api/chartforgex-core-chartannotationfluent/#method-strokestyle-chartforgex-core-chartannotation-chartforgex-core-chartstrokestyle) parameter `chartAnnotation`
- Method [ChartAnnotationFluent.ValueAxis](/api/chartforgex-core-chartannotationfluent/#method-valueaxis-chartforgex-core-chartannotation-chartforgex-core-chartaxisside) parameter `chartAnnotation`

 Filter members   

    Show inherited   

 

## Constructors

 ChartAnnotation 2 overloads 

 `public ChartAnnotation(ChartAnnotationKind kind, double value, double? endValue, string label, ChartColor color, double opacity, bool showLabel = true)` [#](#constructor-ctor-chartforgex-core-chartannotationkind-double-nullable-system-double-string-chartforgex-primitives-chartcolor-double-boolean) 

[ChartAnnotation.cs:88](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L88)

Initializes a new instance of the [ChartAnnotation](/api/chartforgex-core-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)` [#](#constructor-ctor-chartforgex-core-chartannotationid-chartforgex-core-chartannotationkind-double-nullable-system-double-string-chartforgex-primitives-chartcolor-double-boolean) 

[ChartAnnotation.cs:121](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L121)

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)` [#](#member-94c9d0682135747e6b152e89) 

[ChartAnnotation.Source.cs:50](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L50)

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**

Returns

 `ChartAnnotation` 

 `public static ChartAnnotation Note(ChartPoint anchor, string label, ChartColor color, ChartAnnotationId? id = null, ChartAxisSide yAxis = Primary, bool showLabel = true)` [#](#method-note-chartforgex-primitives-chartpoint-string-chartforgex-primitives-chartcolor-nullable-chartforgex-core-chartannotationid-chartforgex-core-chartaxisside-boolean) 

[ChartAnnotation.Source.cs:45](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L45)

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**

Returns

 `ChartAnnotation` 

 `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)` [#](#member-9cf41aa0daa7da8656028e55) 

[ChartAnnotation.Source.cs:56](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L56)

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**

Returns

 `ChartAnnotation` 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public ChartAnnotationId? Id { get; }` [#](#property-id) 

[ChartAnnotation.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L11)

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

 `public ChartAnnotationKind Kind { get; }` [#](#property-kind) 

[ChartAnnotation.cs:21](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L21)

Gets the annotation kind.

 `public double Value { get; }` [#](#property-value) 

[ChartAnnotation.cs:26](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L26)

Gets the first annotation value.

 `public double? EndValue { get; }` [#](#property-endvalue) 

[ChartAnnotation.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L31)

Gets the second annotation value for band annotations.

 `public string Label { get; }` [#](#property-label) 

[ChartAnnotation.cs:36](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L36)

Gets the annotation label.

 `public bool ShowLabel { get; }` [#](#property-showlabel) 

[ChartAnnotation.cs:42](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L42)

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; }` [#](#property-color) 

[ChartAnnotation.cs:47](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L47)

Gets the annotation color.

 `public double Opacity { get; }` [#](#property-opacity) 

[ChartAnnotation.cs:52](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L52)

Gets the annotation opacity used for band fills.

 `public ChartStrokeStyle? StrokeStyle { get; set; }` [#](#property-strokestyle) 

[ChartAnnotation.cs:56](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L56)

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; }` [#](#property-valueaxis) 

[ChartAnnotation.cs:67](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.cs#L67)

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

 `public ChartPoint? SourceStart { get; }` [#](#property-sourcestart) 

[ChartAnnotation.Source.cs:8](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L8)

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

 `public ChartPoint? SourceEnd { get; }` [#](#property-sourceend) 

[ChartAnnotation.Source.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L11)

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

 `public double ChannelOffset { get; }` [#](#property-channeloffset) 

[ChartAnnotation.Source.cs:15](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L15)

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

 `public ChartAxisSide SourceYAxis { get; }` [#](#property-sourceyaxis) 

[ChartAnnotation.Source.cs:18](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartAnnotation.Source.cs#L18)

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)` [#](#extension-strokestyle-chartforgex-core-chartannotation-chartforgex-core-chartstrokestyle) 

Sets [ChartAnnotation.StrokeStyle](/api/chartforgex-core-chartannotation/): 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

```csharp
// C# initializer or property           // C# fluent
chartAnnotation.StrokeStyle = value;    chartAnnotation.StrokeStyle(value);
```

 `public static ChartAnnotation ValueAxis(ChartAnnotation chartAnnotation, ChartAxisSide value)` [#](#extension-valueaxis-chartforgex-core-chartannotation-chartforgex-core-chartaxisside) 

Sets [ChartAnnotation.ValueAxis](/api/chartforgex-core-chartannotation/): 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

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

<!-- PowerForge markdown artifact sha256:862EC775F04E06A0B5F1D8C5B892DBC195EB89AEDA7DDD0DF477BBE6DF45BAA7 -->
