# Overlay arc with linemeter

I was experimenting with arc and linemeter; thought they were similar, but far from it.
This is the code to use to arrive at the following:

void lv_ap_arc_1. (lv_obj_t *& arc, int hor, int ver, int start_angle, int end_angle, int rotation);
void lv_ap_linemeter_1(lv_obj_t & lmeter, int hor, int ver, int angle, int angle_offset, int num, bool mirror);
… (for the innermost part:)
int lm_off= 75;
rot= 270;
f= 0.3;
span= 90;
cE= (rot - 90 + (int)(span
0.5)) % 360;
cS= (cE + 360 - span) % 360; // wouldn’t it be nice to allow e.g. -180° ?
width= (int) (LV_HOR_RES_MAX * f);
height= (int) (LV_VER_RES_MAX * f);
lv_ap_arc_1 (arcD, width, height, cS, cE, 0);
lv_ap_linemeter_1(lmeterD, width - lm_off, height - lm_off, span, rot, 6, false);

Questions and remarks:
a) arc object is square, linemeter is circle; to make linemeter it fit inside an arc, use for arc:
b) is it possible to get rid of the DOT that composes start and end of the arc?
c) can one somehow superimpose (or at least make it touch each other) arc and linemeter?
d) is transparent color available for non-IMAGE objects?
e) for ease of use it might be easier to harmonize the start/end_angle resp angle, angle_offset parameters.

Hi,

In v8, gauge and linemeter is merged into a single object, called “meter”. See the examples here:

1 Like

cool!
would it be possible to have two critical end-zones, like a blue at the start and a red at the end? indicating e.g. too cold and too hot!

Yes, you can create any number of “scales” (ticks + labels) and add any number of “arc”, “needle”, “tick recolor” indicators to the scales.