Bar
The bar fills by the tag value from “Minimum” to “Maximum”, vertically or horizontally: a tank level, a motor load, an opening percentage. High and low limit marks are drawn on the bar, and the fill beyond a limit is painted in the limit color. “Fill by value” changes the color by thresholds, “Scale” adds ticks at the side, “Shaded” gives a cylinder gradient.
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
Tag |
tag name | Tag | |
Minimum |
number | 0 |
Minimum |
Maximum |
number | 100 |
Maximum |
Orientation |
Vertical, Horizontal |
Vertical |
Direction |
Fill |
#RRGGBB |
#2F6FB0 |
Fill color |
FillRules |
text | Fill by value. “threshold:colour” pairs separated by “;”, for example 0:#F2F3F4; 50:#F9C800; 80:#D32F2F. The colour of the highest threshold not above the value is used; below all thresholds the normal colour applies | |
ShowScale |
true / false |
false |
Scale. Ticks and value labels on the side |
ScaleDivisions |
integer | Scale divisions. Empty — 5 | |
HighLimit |
number | Upper limit. Mark on the bar; above it the fill takes the limit color | |
LowLimit |
number | Lower limit. Mark on the bar; below it the fill takes the limit color | |
LimitColor |
#RRGGBB |
#F57C00 |
Color beyond limit |
Background |
#RRGGBB |
Background. Empty part of the bar; empty — light field | |
BorderColor |
#RRGGBB |
Border color | |
BorderWidth |
number | 1 |
Border width |
Shaded |
true / false |
false |
Shaded fill. Gradient, like a cylinder |
ShowValue |
true / false |
false |
Show value. Number over the bar |
Format |
text | 0.## |
Format. Number of value and scale |
FontSize |
number | 11 |
Font size |
ScaleColor |
#RRGGBB |
Scale color | |
ValueColor |
#RRGGBB |
Value color |
From scripts
Section titled “From scripts”Item.Type = Bar. Any property is read and changed by name: Item.Fill = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Events
Section titled “Events”Mouse, hover, focus and keyboard — as for any element (see Events and functions).
Examples
Section titled “Examples”The scale from the datasheet of the selected tank — a selection button script.
var bar = Screen.Items("Level");bar.Tag = "Tank" + Tags("Tank.Selected").Value + ".Level";bar.Maximum = Tags("Tank" + Tags("Tank.Selected").Value + ".Height").Value;Limits from setpoint tags — the Screen opened event script.
var bar = Screen.Items("Level");bar.HighLimit = Tags("Tank1.HighSP").Value;bar.LowLimit = Tags("Tank1.LowSP").Value;