Search Results for

Show / Hide Table of Contents

# Class TextAnnotation

Displays text at a given position (in screen space or graph space)

##### Inheritance

System.Object
TextAnnotation

##### Implements

IAnnotation

###### Namespace: Terminal.Gui.Graphs

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class TextAnnotation : Object, IAnnotation

### Constructors

#### TextAnnotation()

##### Declaration

    public TextAnnotation()

### Properties

#### BeforeSeries

True to add text before plotting series. Defaults to false

##### Declaration

    public bool BeforeSeries { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

#### GraphPosition

The location in graph space to draw the Text. This annotation will only show if the point is in the current viewable area of the graph presented in the GraphView

##### Declaration

    public PointF GraphPosition { get; set; }

##### Property Value

Type | Description
--- | ---
PointF |

#### ScreenPosition

The location on screen to draw the Text regardless of scroll/zoom settings. This overrides GraphPosition if specified.

##### Declaration

    public Nullable<Point> ScreenPosition { get; set; }

##### Property Value

Type | Description
--- | ---
System.Nullable<Point> |

#### Text

Text to display on the graph

##### Declaration

    public string Text { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

### Methods

#### DrawText(GraphView, Int32, Int32)

Draws the Text at the given coordinates with truncation to avoid spilling over of the `graph`

##### Declaration

    protected void DrawText(GraphView graph, int x, int y)

##### Parameters

Type | Name | Description
--- | --- | ---
GraphView | graph |
System.Int32 | x | Screen x position to start drawing string
System.Int32 | y | Screen y position to start drawing string

#### Render(GraphView)

Draws the annotation

##### Declaration

    public void Render(GraphView graph)

##### Parameters

Type | Name | Description
--- | --- | ---
GraphView | graph |

### Implements

IAnnotation