Skip to content

Arc~

obj:arc

lv_arc

Property Value Default Description
min int16 0 minimum value of the indicator
max int16 100 maximum value of the indicator
val int16 0 current value of the indicator
rotation int16 0 offset to the 0 degree position
type 0-2 0 0 = normal, 1 = symmetrical, 2 = reverse
adjustable bool false Add knob that the user can operate to change the value
start_angle 0-360 start angle of the arc background (see note)
end_angle 0-360 end angle of the arc background (see note)
start_angle10 0-360 start angle of the arc indicator (see note)
end_angle10 0-360 end angle of the arc indicator (see note)

Note

Zero degree is at the middle right (3 o'clock) of the object and the degrees are increasing in a clockwise direction. The angles should be in the [0-360] range.
min, max and val also support negative values.

Tip

To adjust the size of the knob, use pad_top20, pad_bottom20, pad_left20, pad_right20 styling properties. If you increase the knob beyond the margins of the object, you also need to increase pad_top, pad_bottom, pad_left, pad_right for the arc itself.
Check out value styling to display a textual value in the middle of the arc.

Example jsonl
1
{"page":1,"id":9,"obj":"arc","x":20,"y":75,"w":200,"h":200,"min":15,"max":35,"border_side":0,"type":0,"rotation":0,"start_angle":135,"end_angle":45,"start_angle10":135,"end_angle10":45,"adjustable":true}

While pressing and dragging the arc object the following events are sent: down (old value), changed (repeatedly until released) and up (value at the moment of releasing it):

1
2
3
4
5
6
7
{"event":"down","val":21}
{"event":"changed","val":22}
{"event":"changed","val":23}
{"event":"changed","val":25}
{"event":"changed","val":27}
{"event":"changed","val":29}
{"event":"up","val":31}

Last update: 2024-04-26