PlotText
- Updated2023-02-21
- 4 minute(s) read
PlotText
int PlotText (int panelHandle, int controlID, double xCoordinate, double yCoordinate, char text[], char metaFont[], int textColor, int backgroundColor);
Purpose
Plots a text string onto a graph control.
The origin of the text is the lower left corner of the string. You specify the origin of the text in terms of the x- and y-coordinates of the graph.
If the ATTR_SHIFT_TEXT_PLOTS graph attribute is non-zero, the text origin is within the graph area, and the text does not entirely fit within the graph, the text shifts to the left and/or down until it is completely visible. If ATTR_SHIFT_TEXT_PLOTS is zero, the text does not shift.
Supported Controls
You can use PlotText 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. | ||||||||||||||||||||||||||||||||||||||||||
xCoordinate | double | Horizontal position at which to place the left edge of the text within the graph. The default value is 0.0. Normally, the xCoordinate corresponds to the left edge of the text. However, if the text origin is within the graph area and the complete text cannot fit within the plot area, the text shifts to the left until it is completely visible. |
||||||||||||||||||||||||||||||||||||||||||
yCoordinate | double | Vertical position at which to place the bottom edge of the text within the graph. The default value is 0.0. Normally, the yCoordinate corresponds to the bottom edge of the text. However, if the text origin is within the graph area and the complete text cannot fit within the plot area, the text shifts down until it is completely visible. |
||||||||||||||||||||||||||||||||||||||||||
text | char [] | String to plot. | ||||||||||||||||||||||||||||||||||||||||||
metaFont | char [] | The font to use for the text string. metaFont can be a predefined NI metafont or a user-defined metafont saved by a previous call to functions such as CreateMetaFont and CreateMetaFontEx. The following are NI metafonts: Predefined metafonts—Contain typeface information, point size, and text styles such as bold, underline, italic, and strikeout. These metafonts are used in the LabWindows/CVI environment. The predefined metafonts are VAL_MENU_META_FONT, VAL_DIALOG_META_FONT, VAL_EDITOR_META_FONT, VAL_APP_META_FONT, and VAL_MESSAGE_BOX_META_FONT. LabWindows/CVI-supplied metafonts—Use typefaces that are not native to the operating system. These metafonts are installed while LabWindows/CVI is running. The LabWindows/CVI-supplied metafonts are VAL_7SEG_META_FONT and VAL_SYSTEM_META_FONT. |
||||||||||||||||||||||||||||||||||||||||||
textColor | int | The color of the plotted text. An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value. The first sixteen colors in the table are the sixteen standard colors.
You also can use the User Interface Library function, MakeColor, to create an RGB value from red, green, and blue color components. To enter user-defined color values, select Options»Toggle Control Style in the function panel and manually enter the color value. |
||||||||||||||||||||||||||||||||||||||||||
backgroundColor | int | The background color of the plotted text. An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value. The first sixteen colors in the table are the sixteen standard colors.
You also can use the User Interface Library function, MakeColor, to create an RGB value from red, green, and blue color components. To enter user-defined color values, select Options»Toggle Control Style in the function panel and manually enter the color value. |
Return Value
Name | Type | Description | ||
plotHandle | int | The handle of the new plot that you can use in subsequent function calls to reference the plot. If the handle is positive, the new plot was successfully added to the graph. Negative values indicate that an error occurred.
|
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later