Repository navigation
User JSON LineIndicator
Back to list | Indicator page | Русский
This page describes the JSON template of the line indicator for manual editing of .vttp. The indicator draws a straight line with a given direction, color, thickness and style.
{
"name": "com.velitask.plagin.official.line",
"data": {
"maket": { "preset": "auto" },
"properties": {
"line": {
"lineColor": {"r":255,"g":255,"b":255,"a":255},
"thickness": {},
"style": {"value":0},
"dashPattern": {"value":""}
},
"direction": {"value":0}
}
}
}The numeric field thickness is written as an empty object {}: this is the default value (see the description of the setting for details).
The line ("Line"): color, thickness, line style and dash pattern.
{
"line": {
"lineColor": {"r":255,"g":255,"b":255,"a":255},
"thickness": {},
"style": {"value":0},
"dashPattern": {"value":""}
}
}| Field | Values | What it does |
|---|---|---|
lineColor |
color object | Line color ("Line color"). |
thickness.value |
0..50 |
Thickness ("Thickness"). In the picture it is never less than one pixel. An empty object {} means the default value 1; to set your own, use {"value": N}. |
style.value |
0..7 |
Line style ("Line style"). |
dashPattern.value |
string of numbers separated by commas | Dash pattern ("Dash pattern"). An empty string means a solid line. |
Fields of the lineColor color:
| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Transparency: 0 fully transparent, 255 opaque. |
Values of style.value:
| Value | Line style | Pattern for dashPattern
|
|---|---|---|
0 |
Solid | empty |
1 |
Dash | 12,6 |
2 |
Dot | 2,4 |
3 |
Dash-dot | 12,6,2,6 |
4 |
Dash-dot-dot | 12,6,2,6,2,6 |
5 |
Long dash | 20,8 |
6 |
Short dash | 6,4 |
7 |
Custom | any pattern of yours |
The line is drawn by the dashPattern pattern, not by the style number, so when editing by hand write into dashPattern the pattern that corresponds to the chosen style. If the pattern contains a non-number or a number that is not greater than zero, the line is drawn solid.
The direction of the line ("Direction").
{
"direction": {"value":0}
}| Field | Values | What it does |
|---|---|---|
value |
0, 1, 2, 3
|
Number of the direction (0 by default). |
| Value | Direction |
|---|---|
0 |
Horizontal: along the middle of the layer height, from the left edge to the right edge |
1 |
Vertical: along the middle of the layer width, from the top edge to the bottom edge |
2 |
Diagonal ↘: from the top left corner to the bottom right corner |
3 |
Diagonal ↗: from the bottom left corner to the top right corner |