Widget to draw a linear scale

This is like the linemeter except it is linear, not curved. Sorry about the name but I was working in the existing names.
Coupled with a bar it serves as a labeled axis. The chart has some similar logic.

linearscale_v

With a bar and label it makes a display

linearscale_h

The code below will not work unless you add the define to lv_conv.h. And you should update the themes too.

/*Linear scale (dependencies: *;)*/
#define LV_USE_LINEARSCALE 1

But I wanted to post this here to see if it was worth incorporating into the main code. Probably it needs a couple of style attributes added, like tick ratios.


3 Likes

Looks great! Better yet if the ticks could be over the bar meter to save screen space.

If you align the scale over the bar then it will show over the top.

linearscale_o

2 Likes

Looks good! Thank you for sharing!

Hi! Do you have plans do add it to the main source tree?