int PlotWaveform (int panelHandle, int controlID, void *yArray, int numberOfPoints, int yDataType, double yGain, double yOffset, double initialX, double xIncrement, int plotStyle, int pointStyle, int lineStyle, int pointFrequency, int color);
Plots a waveform onto a graph control.
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. |
yArray |
void * |
Array that contains the values to plot along the y-axis. The data type must be of the type specified by yDataType. |
numberOfPoints |
integer |
Number of points to plot. This value controls the number of points to plot even if the number of elements in xArray is greater than the numberOfPoints.
numberOfPoints must be greater than zero. |
yDataType |
integer |
The data type of the y array. The following table lists the valid data types.
VAL_CHAR |
A single byte character. |
VAL_DOUBLE |
An 8 byte floating point value. |
VAL_FLOAT |
A 4 byte floating point value. |
VAL_INTEGER |
A 4 byte integer. |
VAL_SHORT_INTEGER |
A 2 byte integer. |
VAL_UNSIGNED_CHAR |
An unsigned single byte character. |
VAL_UNSIGNED_INTEGER |
An unsigned 4 byte integer. |
VAL_UNSIGNED_SHORT_INTEGER |
An unsigned 2 byte integer. |
|
yGain |
double-precision |
The gain to apply to the waveform (yArray) data.
The default value is 1.0. |
yOffset |
double-precision |
A constant offset to add to the waveform (yArray) data.
The default value is 0.0. |
initialX |
double-precision |
The initial value for the x-axis.
The default value is 0.0. |
xIncrement |
double-precision |
The increment along the x-axis for each new point.
The default value is 1.0. |
plotStyle |
integer |
Curve style to use when plotting the data points. The default value is VAL_THIN_LINE. The following table lists valid styles.
VAL_THIN_LINE |
A single thin line. The data points are plotted as a sequence of connected line segments, drawn from point to point. The line segments are 1 pixel wide. No marker symbols are drawn at any of the
data points. |
VAL_FAT_LINE |
A fat line. The data points are plotted as a sequence of connected line segments, drawn from point to point. The line segments are 3 pixels wide. No marker symbols are drawn at any of the data points. VAL_FAT_LINE forces lineStyle to solid. |
VAL_CONNECTED_POINTS |
A single thin line with asterisk characters at each plotted point. Similar to VAL_THIN_LINE except that marker symbols are drawn at some or all of the data points, depending on the selected point frequency. |
VAL_SCATTER |
Asterisk characters at each plotted point with no lines connecting each point. |
VAL_THIN_STEP |
A thin line stepping from one point to the next. The data points are connected by two 1-pixel
wide lines at right angles to each other, the vertical drawn first, then the horizontal. |
VAL_FAT_STEP |
A fat line stepping from one point to the next. The data points are connected by two 3-pixel wide lines at right angles to each other, the vertical drawn first, then the horizontal. |
VAL_VERTICAL_BAR |
Vertical bars are plotted for each plotted point. The bars extend upward from
the minimum value, where the height of the bar represents the magnitude of the data point. |
VAL_HORIZONTAL_BAR |
Horizontal bars are plotted for each plotted point. The bars extend to the
right from the minimum value, where the length of the bar represents the magnitude of the data point. |
VAL_BASE_ZERO_ VERTICAL_BAR |
Vertical bars are plotted for each plotted point. The bars extend upward and
downward from zero, depending on whether the data value is positive or negative. |
VAL_BASE_ZERO_ HORIZONTAL_BAR |
Horizontal bars are plotted for each plotted point. The bars extend to the
left and right from zero, depending on whether the data value is positive or negative. |
|
pointStyle |
integer |
Point style to use when plotting the array. The point style determines the type of marker to draw when the plot style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is VAL_EMPTY_SQUARE.
VAL_EMPTY_SQUARE |
An empty square. |
VAL_SOLID_SQUARE |
A solid square. |
VAL_ASTERISK |
An asterisk type character. |
VAL_DOTTED_EMPTY_SQUARE |
An empty square with a dot in its center. |
VAL_DOTTED_SOLID_SQUARE |
A solid square with a dot in its center. |
VAL_SOLID_DIAMOND |
A diamond shape (similar to a cross). |
VAL_EMPTY_SQUARE_WITH_X |
An empty square with an X-like shape in its center. |
VAL_EMPTY_SQUARE_WITH_CROSS |
An empty square with a cross in its center. |
VAL_BOLD_X |
A bold X-like shape. |
VAL_SMALL_SOLID_SQUARE |
A small solid square. |
VAL_SIMPLE_DOT |
A small dot. |
VAL_EMPTY_CIRCLE |
An empty circle. |
VAL_SOLID_CIRCLE |
A solid circle. |
VAL_DOTTED_SOLID_CIRCLE |
A circle with a dot in its center. |
VAL_DOTTED_EMPTY_CIRCLE |
A solid circle with a a dot in its center. |
VAL_BOLD_CROSS |
A bold cross of equal height and width. |
VAL_CROSS |
A cross of equal height and width. |
VAL_SMALL_CROSS |
A small cross of equal height and width. |
VAL_X |
An X-like shape. |
VAL_SMALL_X |
A small X-like shape. |
VAL_DOTTED_SOLID_DIAMOND |
A solid diamond shape with a dot in its center. |
VAL_EMPTY_DIAMOND |
An empty diamond shape. |
VAL_DOTTED_EMPTY_DIAMOND |
An empty solid diamond shape with a dot in its center. |
VAL_SMALL_EMPTY_SQUARE |
A small empty square. |
VAL_NO_POINT |
No cursor point. |
|
lineStyle |
integer |
The line style.
VAL_SOLID |
A solid line. |
VAL_DASH |
A dashed line. |
VAL_DOT |
A dotted line. |
VAL_DASH_DOT_DOT |
A line alternating between one dash and two dots. |
VAL_DASH_DOT |
A line with alternating dashes and dots. |
|
pointFrequency |
integer |
The point interval at which to draw marker symbols when the curve style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is 1 and can be as large as the number of points in the plot. |
color |
integer |
Specifies the color of the data to plot.
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.
Value |
Code |
VAL_RED |
0xFF0000L |
VAL_GREEN |
0x00FF00L |
VAL_BLUE |
0x0000FFL |
VAL_CYAN |
0x00FFFFL |
VAL_MAGENTA |
0xFF00FFL |
VAL_YELLOW |
0xFFFF00L |
VAL_DK_RED |
0x800000L |
VAL_DK_BLUE |
0x000080L |
VAL_DK_GREEN |
0x008000L |
VAL_DK_CYAN |
0x008080L |
VAL_DK_MAGENTA |
0x800080L |
VAL_DK_YELLOW |
0x808000L |
VAL_LT_GRAY |
0xC0C0C0L |
VAL_DK_GRAY |
0x808080L |
VAL_BLACK |
0x000000L |
VAL_WHITE |
0xFFFFFFL |
VAL_PANEL_GRAY |
0xC0C0C0L |
VAL_GRAY |
0xA0A0A0L |
VAL_OFFWHITE |
0xE0E0E0L |
VAL_TRANSPARENT |
0x1000000L |
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. |