Skip to main content
Version: v3

ARC_PROGRESS

Arc progress widget draws arc progress, supports start angle, line width, end angle, color, progress scale.

Create UI widget

const arcProgress = hmUI.createWidget(hmUI.widget.ARC_PROGRESS, Param)

Type

Param: object

PropertiesDescriptionRequiredType
center_xCenter of circle xYESnumber
center_yCenter of circle yYESnumber
radiusRadiusYESnumber
start_angleThe angle at the beginning of the arc. (0 degrees is the positive three o'clock direction)YESnumber
end_angleThe angle at the end of the arc. (0 degrees is the positive three o'clock direction)YESnumber
line_widthWidth of circular arc.YESnumber
colorColor of circular arc.YESnumber
src_bgBackground images.NOstring
levelThe scale of arc progress. [0-100]NOnumber

Code example

const arcProgress = hmUI.createWidget(hmUI.widget.ARC_PROGRESS)
arcProgress.setProperty(hmUI.prop.MORE, {
center_x: 100,
center_y: 100,
radius: 200,
start_angle: -90,
end_angle: 90,
color: 0x34e073,
line_width: 10,
level: 50
})