Bar

Deprecated. Do not use in new code.

Description: Draws a filled bar on the screen.
Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: Box | GUIRectangle | ZBox | Scale
Format: Bar(X1, Y1, X2, Y2, Foreground, Pattern, Background)
Parameters:  
X1
Required. Any numeric expression giving the X coordinate one side of the bar on the screen (either left or right).
Y1
Required. Any numeric expression giving the Y coordinate of either the top or bottom of the bar on the screen.
X2
Required. Any numeric expression giving the X coordinate of the side of the bar opposite to X1 on the screen (either left or right).
Y2
Required. Any numeric expression giving the Y coordinate of either the top or bottom of the bar, whichever is the opposite to Y1.
Foreground
Required. Any numeric expression giving the foreground VTScada Color Palette of the bar.
Pattern
Required. Any numeric expression giving the hatch pattern to use to fill the bar. The valid hatch style numbers are from 1 to 25 inclusive. A Pattern of 1 is a solid bar. For valid pattern numbers, please refer to Fill Patterns).
Background
Required. Any numeric expression giving the background color for the hatch pattern used to fill the bar. This value is only significant if the Pattern parameter is not equal to 1 (solid).

Comments

This statement has been superseded by the GUIRectangle and ZBar statements, and is maintained for backwards compatibility only.

As of version 11, this is now drawn in the same z-order as other graphics, making it similar to the z-graphics functions.

It is recommended that you use bars without hatch patterns for animation, as solid bars are drawn faster.

Example:

Bar(700, 30, 740, 60 { Coordinates outlining the bar },
    2 { Dark green foreground },
    4 { Striped hatch pattern },
    10 { Bright green background });

This example draws a small bar in the upper right corner of the screen using a two-tone green striped hatch pattern.

Bar(10, 600 { X and Y coordinates of lower left corner },
    200 Scale(temperature, 0, 150, 100, 500)
    { Make upper right corner move with temp },
    4, 1, 0 { Solid red color });

The example above displays a vertical bar graph of temperature. Note that the Y2 coordinate is dependent on a scale of temperature. Every time the value of temperature changes, the Bar will redraw itself to the new upper right corner. The Scale function transforms the temperature (0 to 150) to screen coordinates (100 to 500). However, if temperature should go below 0 or above 150, the bar will still be drawn to the corresponding screen coordinates (above 100 or below 500). To limit the action of the moving bar, try the following:

Bar(10, 600 { X and Y coordinates of lower left corner},
    200, Scale(Limit(temperature, 0, 150), 0, 150, 100, 500)
    { Make upper right corner move with temperature},
    4, 1, 0 { Solid red color });

This limits the value of temperature used in the scale (it does not limit the value of the temperature variable itself).