Cicode Programming Reference > Cicode Function Categories > Plot Functions Introduction > PlotLine

PlotLine

Draws a line (in the CitectSCADA plot system) for a set of data points. You specify the data points in the table pTable, and plot these points between the LoScale and HiScale values. The line is drawn inside the frame defined by the PlotGrid() function.

For each line on a plot, you can specify a different pen style, color, and width, and a different marker style and color. You can draw lines either from left to right or from right to left.

you need to first call the PlotOpen() function to get the handle for the plot (hPlot) and specify the output device. You should then use the PlotGrid() function to set up the frame and grid, before you call this function to plot the line.

Syntax

PlotLine(hPlot, PenStyle, PenCol, PenWidth, MarkerStyle, MarkerCol, nMarker, Length, pTable, LoScale, HiScale, Mode)

hPlot:

The plot handle, returned from the PlotOpen() function. The plot handle identifies the table where all data on the plot is stored.

PenStyle:

The style of the pen used to draw:

0 - Solid

1 - Dash ( - - - - - )

2 - Dot (...............................)

3 - Dash and dot ( - . - . - . - . - )

4 - Dash, dot, dot ( - . . - . . - . . - )

5 - Hollow

PenCol:

The color of the pen (flashing color is not supported). Select a color from the list of Predefined Color Names and Codes or create an RGB-based color using the function MakeCitectColor.

PenWidth:

The width of the pen, in pixels. If the width is thicker than one pixel, you need to use a solid pen (PenStyle = 0). The maximum width is 32.

MarkerStyle:

The style of the markers:

0 - No markers

1 - Triangle

2 - Square

3 - Circle

4 - Diamond

5 - Filled triangle

6 - Filled square

7 - Filled circle

8 - Filled diamond

20 - 32000 - User-defined markers. You can register any symbol as a marker with the PlotSetMarker() function. Call the PlotGetMarker() function if the number of markers you have previously registered are unknown.

MarkerCol:

The color of the markers (flashing color is not supported). Select a color from the list of predefined color names and codes or create an RGB-based color using the function MakeCitectColor.

nMarker:

The number of samples between markers.

Length:

The length of the array, that is, the number of points in the table pTable for PlotLine(), or in tables xTable and yTable for PlotXYLine().

pTable:

The points to be plotted (as an array of floating-point values).

LoScale:

The lowest value that will be displayed on the plot (that is the value assigned to the origin of your grid). The LoScale and HiScale values determine the scale of your grid. This scale is used to plot values. for example, If LoScale = 0 (zero) and HiScale = 100, a value of 50 will be plotted half way up the Y-axis of your grid. LoScale needs to be in the same units as the values in pTable.

HiScale:

The highest value that will be displayed on the plot. The LoScale and HiScale values determine the scale of your grid. This scale is used to plot values. for example, If LoScale = 0 (zero) and HiScale = 100, a value of 50 will be plotted half way up the Y- axis of your grid. HiScale needs to be in the same units as the values in pTable.

Mode:

The origin of your grid, and the direction of the plotted line:

1 - Origin is bottom-left, x is left to right, y is upwards

2 - Origin is bottom-right, x is right to left, y is upwards

4 - Origin is top-left, x is left to right, y is downwards

8 - Origin is top-right, x is right to left, y is downwards

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

PlotClose, PlotDraw, PlotGetMarker, PlotGrid, PlotInfo, PlotMarker, PlotOpen, PlotScaleMarker, PlotSetMarker, PlotText, PlotXYLine, TrnPlot

Example

See PlotOpen

See Also

Plot Functions