Working with lv_chart in SLS v1.1.1:
// ui_ChartBat common definitions
lv_chart_set_type(ui_ChartBat, LV_CHART_TYPE_SCATTER);// by (x,y) coord
lv_chart_set_div_line_count(ui_ChartBat,6,11);// кол-во разделительных линий x,y
// ui_ChartBat Y axis
// ui_ChartBat X axis
How I can ‘clear’ the chart (all points) for the SCATTER type? I need to clear the x and y points.
Trying the following:
lv_chart_set_all_value clears y points only.
- My idea of
working bad for the first point.
lv_chart_remove_series(ui_ChartBat,ser1);// clear old plot
ser1 = lv_chart_add_series(ui_ChartBat,lv_palette_main(LV_PALETTE_RED),LV_CHART_AXIS_PRIMARY_Y);
Is this a good solution? However, lv_chart_refresh runnig a bit later…
It should work
lv_chart_set_all_value(chart, ser, LV_CHART_POINT_NONE);
LV_CHART_POINT_NONE is not the same as
0, as it means “do not display that value”.
In other words, is it right approch:
- If we need to delete all the SCATTER points, we should use add/remove series functions.
- If we need to only hide the points we can use lv_chart_set_all_value(chart, ser, LV_CHART_POINT_NONE).
And may be last question: how to draw connecting dots could be disable? If number of points is to big, the dots not needed anymore, I think.
What do you mean by delete points? What is difference between hide and delete?
You can hide the dots with:
lv_obj_set_style_size(chart, 0, LV_PART_INDICATOR);
When we delete it mean all points cannot be displayed, not keeped anywhere in LVGL variables, cannot be restored anymore. The ‘hide’ means it currently not displayed, but may be displayed later if necessary.
Hope, to delete points it need to remove series.
The next question attached…
screen.rar (798.0 KB)