# AddGraphAnnotation

int AddGraphAnnotation (int panelHandle, int controlID, double x, double y, char *captionText, int xOffset, int yOffset);

## Purpose

Adds a new graph annotation at the coordinates specified by x and y. The caption text is offset from the annotation point by xOffset and yOffset.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
x | double-precision | The x-coordinate of the annotated point. The annotation glyph will be displayed at this point.
y | double-precision | The y-coordinate of the annotated point. The annotation glyph will be displayed at this point.
captionText | char * | The string displayed in the annotation caption. Pass NULL for the captionText to create an empty caption that is initially hidden.
xOffset | integer | The x-offset, in pixels, from the top-left corner of the caption to the annotated point.
yOffset | integer | The y-offset, in pixels, from the top-left corner of the caption to the annotated point.

## Return Value

Name | Type | Description
annotationIndex | integer | Returns the index you can use to specify the annotation in subsequent function calls. This index is also the number of annotations currently on the graph. Negative values indicate that an error occurred. Zero is not a valid index.
Code | Error Message String
xx | Annotation Index (Success)