Arc Label (lv_arclabel)

Display text along an arc — useful for gauges, dials, and other curved layouts.

Edit on GitHub

Overview

The Arc Label displays text along an arc. Useful for gauges, dials, and any layout where the text needs to follow a curved path. You can set the text, direction, radius, alignment, and color.

Styling

  • LV_PART_MAIN covers both the arc path and the text drawn along it. Use the typical text and background style properties to change the look.

Text Management

Angle Configuration

Direction

Specify the text direction along the arc using lv_arclabel_set_dir(arclabel, LV_ARCLABEL_DIR_CLOCKWISE) or lv_arclabel_set_dir(arclabel, LV_ARCLABEL_DIR_COUNTERCLOCKWISE).

  • LV_ARCLABEL_DIR_CLOCKWISE Text flows in a clockwise direction along the arc.
  • LV_ARCLABEL_DIR_COUNTERCLOCKWISE Text flows in a counter-clockwise direction along the arc.

Alignment

Adjust vertical text alignment with lv_arclabel_set_text_vertical_align(arclabel, LV_ARCLABEL_TEXT_ALIGN_CENTER). Set horizontal alignment using lv_arclabel_set_text_horizontal_align(arclabel, LV_ARCLABEL_TEXT_ALIGN_CENTER).

Both vertical and horizontal use the same logic.

Radius and Center Offset

Color and Recoloring

Enable text recoloring with lv_arclabel_set_recolor(arclabel, true). This allows parts of the text to be colored differently using color commands embedded in the text string.

Interactive Behavior

Arc Label is not clickable by default. Add the LV_OBJ_FLAG_CLICKABLE flag if you want it to receive input events.

Events

No special events. The widget inherits the events common to all widgets.

Keys

No special keys. Add the widget to a group if you need keypad input.

Example

Simple Arc Label

Last updated on

On this page