# VisualCanvasTextLayer

Plain text layer with either an explicit color or the canvas primary foreground.

 Class  

`ChartForgeX.Composition`

**Namespace**

`ChartForgeX.Composition`

**Assembly**

`ChartForgeX.Visuals`

**Source**

[VisualCanvasTextLayer.cs:19](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L19)

**Base**

`VisualCanvasLayer`

**Modifiers**

sealed

Plain text layer with either an explicit color or the canvas primary foreground.

## Inheritance

- [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)
- VisualCanvasTextLayer

 Filter members   

    Show inherited   

 

## Constructors

 VisualCanvasTextLayer 2 overloads 

 `public VisualCanvasTextLayer(double x, double y, double width, string text, double fontSize)` [#](#constructor-ctor-double-double-double-string-double) 

[VisualCanvasTextLayer.cs:19](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L19)

Initializes a text layer that follows the canvas primary foreground at render time.

Parameters

**x double required**

The text X coordinate.

**y double required**

The text Y coordinate.

**width double required**

The text width used for alignment and clipping.

**text string required**

The text to render.

**fontSize double required**

The font size.

 `public VisualCanvasTextLayer(double x, double y, double width, string text, double fontSize, ChartColor color)` [#](#constructor-ctor-double-double-double-string-double-chartforgex-primitives-chartcolor) 

[VisualCanvasTextLayer.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L31)

Initializes a text layer with an explicit color, retained independently of the canvas theme.

Parameters

**x double required**

The text X coordinate.

**y double required**

The text Y coordinate.

**width double required**

The text width used for alignment and clipping.

**text string required**

The text to render.

**fontSize double required**

The font size.

**color ChartForgeX.Primitives.ChartColor required**

The explicit text color, including white or transparent.

## 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 string Text { get; set; }` [#](#property-text) 

[VisualCanvasTextLayer.cs:36](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L36)

Gets or sets the text.

 `public double FontSize { get; set; }` [#](#property-fontsize) 

[VisualCanvasTextLayer.cs:38](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L38)

Gets or sets the font size.

 `public ChartColor Color { get; set; }` [#](#property-color) 

[VisualCanvasTextLayer.cs:40](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L40)

Gets the authored color, or white when none was supplied. Setting this property selects an explicit color; an uncolored layer renders with the canvas primary foreground.

 `public TextAlignment Alignment { get; set; }` [#](#property-alignment) 

[VisualCanvasTextLayer.cs:42](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L42)

Gets or sets the text alignment.

 `public bool Emphasized { get; set; }` [#](#property-emphasized) 

[VisualCanvasTextLayer.cs:44](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L44)

Gets or sets whether the text should use the emphasized raster/SVG treatment.

 `public TextStyleOverride? TextStyle { get; set; }` [#](#property-textstyle) 

[VisualCanvasTextLayer.cs:47](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasTextLayer.cs#L47)

Gets or sets optional shared typography resolved over this layer's current font, size and color. Null keeps the legacy path.

## Inherited Properties

 `public double X { get; set; }` [#](#property-x) 

[VisualCanvasModels.cs:500](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasModels.cs#L500)

Inherited from [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)

 `public double Y { get; set; }` [#](#property-y) 

[VisualCanvasModels.cs:503](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasModels.cs#L503)

Inherited from [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)

 `public double Width { get; set; }` [#](#property-width) 

[VisualCanvasModels.cs:506](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasModels.cs#L506)

Inherited from [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)

 `public double Height { get; set; }` [#](#property-height) 

[VisualCanvasModels.cs:509](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasModels.cs#L509)

Inherited from [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)

 `public ChartRect Bounds { get; }` [#](#property-bounds) 

[VisualCanvasModels.cs:512](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Visuals/VisualCanvas/VisualCanvasModels.cs#L512)

Inherited from [VisualCanvasLayer](/api/chartforgex-composition-visualcanvaslayer/)

<!-- PowerForge markdown artifact sha256:BFE96B58E9B4BE161A14E5E38D3CD9F54020EE72E2C557448B840D309A833E01 -->
