Which LVGL'S widget(or Drawing api) i should use for this project?

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

Hello all, I want to draw a circular gauge/meter/progress bar for my project. I am confused about which widget I should use for this project.
–>or else a basic line drawing enough?if yes then what all APIs are available to implement this?
cropped

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

RH850

What LVGL version are you using?

V8

What do you want to achieve?

Based on Value want to change this guage color

What have you tried so far?

identified widgets: meter/Guage/progress bar, if LVGL supports basic drawings like line, circle, and rectangle is supported then I think the basic line of different shades can do this? correct me if I am wrong.

Hi,

It could be a good starting point:

    meter = lv_meter_create(lv_scr_act());
    lv_obj_center(meter);
    lv_obj_set_size(meter, 400, 400);

    /*Add a scale first*/
    lv_meter_set_scale_ticks(meter, 200, 1, 15, lv_palette_main(LV_PALETTE_GREY));

    lv_meter_indicator_t * indic;

    /*Make the tick lines blue at the start of the scale*/
    indic = lv_meter_add_scale_lines(meter, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
                                     false, 0);
    lv_meter_set_indicator_start_value(meter, indic, 0);
    lv_meter_set_indicator_end_value(meter, indic, 70);
    

image

I actually just did this exact thing.

https://sim.lvgl.io/v9.0/micropython/ports/javascript/index.html?memory=8192000&script_startup=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/header.py&script=https://raw.githubusercontent.com/lvgl/lvgl/0d9ab4ee0e591aad1970e3c9164fd7c544ecce70/examples/widgets/slider/lv_example_slider_2.py&script_direct=2f742422c75c16471ae4a701b08f26f8130cf9ca

it’s written in micropython but the code could be ported to C code.