Skip to content

OLED Charts: Linear Indicator (internal_oled_draw_linear_gauge)

What it does: Draws a linear indicator (gauge) for a value in the range 0 to 100.

internal_oled_draw_linear_gauge

Inputs

  • VAL: value of type Value.
  • X: value of type Value.
  • Y: value of type Value.
  • W: value of type Value.
  • H: value of type Value.

Output

  • None (statement block).

When to use it

  • When you want to display percentages (battery, power, progress).
  • For a compact horizontal or vertical indicator in the UI.

Tips and pitfalls

  • The VAL value will be limited to the range 0-100 (_chart_clamp) before drawing.
  • Both coordinates and dimensions pass _chart_int, so non-numeric inputs default.

Generated Python example

oled_charts.draw_linear_gauge(fbuf, _chart_int(0), _chart_int(0), _chart_int(0), _chart_int(0), _chart_clamp(_chart_float(0), 0, 100))