This is a custom widget that is used to monitor the single result value, coloring the background depending on its value and settings.
Methods
# setColors(colors)
Set custom colors for the background. The order of colors are important to determinate the status. First color represents the OK status. The second color represents a regular status. And the third color represents an fail status.
Parameters:
Name | Type | Description |
---|---|---|
colors |
Array.<string>
|
Custom colors. |
# setHeight(height)
Set a custom height of each element status to show.
Parameters:
Name | Type | Description |
---|---|---|
height |
number
|
Height value. |
# setIcons(icons)
Set custom icons. The order of icons are important to determinate the status. First icon represents the OK status. The second icon represents a regular status. And the third icon represents an fail status.
Parameters:
Name | Type | Description |
---|---|---|
icons |
Array.<string>
|
Custom icons. |
# setIsPercent(bool)
Indicate if the comparation of rules must be with percent.
Parameters:
Name | Type | Description |
---|---|---|
bool |
boolean
|
Comparation of values as a percentage. |
- Default Value:
- true
# setItemsByRow(val)
Indicate the number of elements to show by row.
Parameters:
Name | Type | Description |
---|---|---|
val |
number
|
Number of elements. |
- Default Value:
- 4
# setKey(key)
Set the key to be displayed.
Parameters:
Name | Type | Description |
---|---|---|
key |
string
|
Key to show. |
# setRules(success, fail)
Set the rules to define the status.
Operators availables are:
- '>'
- '<'
- '=='
- '<='
- '=>'
- '!='
By default, values are in percentage, so its value should be between 0 and 100. To change this behavior use setIsPercent with false value.
Parameters:
Name | Type | Description |
---|---|---|
success |
Object
|
|
operator |
string
|
Comparator operator. |
value |
number
|
Limit value. |
fail |
Object
|
|
operator |
string
|
Comparator operator. |
value |
number
|
Limit value. |
# setValue(value)
Set the column value to show.
Parameters:
Name | Type | Description |
---|---|---|
value |
value
|
Column name. |