Admin Production ni-theme
Current Publication

AddGraphAnnotation

LabWindows/CVI

AddGraphAnnotation

int AddGraphAnnotation (int panelHandle, int controlID, double x, double y, char *captionText, int captionXOffset, int captionYOffset);

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.

Supported Controls

You can use AddGraphAnnotation with graph controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int 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 functions such as NewCtrl and DuplicateCtrl.
x double The x-coordinate of the annotated point. The annotation glyph will be displayed at this point.
y double 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.
captionXOffset int The x-offset, in pixels, from the top-left corner of the caption to the annotated point.
captionYOffset int The y-offset, in pixels, from the top-left corner of the caption to the annotated point.

Return Value

Name Type Description
annotationIndex int 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.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later

Example

Refer to userint\GraphAnnotations.cws for an example of using the AddGraphAnnotation function.