How to draw the line meter

Description

What MCU/Processor/Board and compiler are you using?

STM32F7

What LVGL version are you using?

v7.9

What do you want to achieve?

draw the line meter as attached

What have you tried so far?

Try the gauge obj, but have no idea to do

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

line_meter

Hi, embeddedt,
Is the above meter too complex? How a about the below , the one have only one scale. It is normal used in the instrument to repalce the old mechanical one. The difficult is to just refresh the area the needle take. I tried adding a window on the gauge by setting a small obj size, but hard to control the outlook. Is there any sample code for such meter?
Happy New Year!

This one is much simpler. It can be done with one gauge object and a label on top. I would start with this example and adapt it. To adjust the angle you would change the scale.

1 Like

Hi, embeddedt,
Many Thanks!
I had tried and it worked, but there have large blank space in the left and right. How to freely adjust the visualable area ? Is there any mask can be apply to an object beside the obj size?

Best Regards,

Try playing around with the padding or margin style properties.

1 Like

Hi, embeddedt,
It works.

Thanks & Best Regards,