Any lv_chart features that are similar to the screenshot below?
So the chart is can be directly changed when the point is dragged.
From what I see in the latest documentation, the nearest features is this: Show cursor on the clicked point
Except it can’t be directly changed nor dragged.
It’s not supported out of the box but you can use lv_chart_get_pressed_point to get the index of the pressed point and set a new value with lv_chart_set_value_by_id.
lv_chart_get_pressed_point are for getting the id, but how to get a coordinate for where I click in chart area so I can set a new value using lv_chart_set_value_by_id ?
If you know what the scale is for the x and y axis on the graph you can get the x, y touchscreen coordinates from LVGL. You would have to may the coordinates to the scale on the graph but that shouldn’t be too hard to do. Then you can set the point
in the above simulator you can see the proper coordinates getting printed out. The first x, y is the location of the point. the second one is where the touch is.
There are several bugs in the chart widget. The first one being the inability to set the position of the point using the ID. It doesn’t work. The second one is no matter where you click on the chart it manages to lock onto a point as being clicked on even if you don’t click on a point. I will be opening up a bug report for this tomorrow morning.
Good, I think the LV_CHART_TYPE_SCATTER are what I need.
But I got another problem, lv_chart_get_pressed_point always return 0 when using LV_CHART_TYPE_SCATTER