LVGL chart控件删除曲线上的点
修改lv_chart.c 文件
找到函数 draw_series_line
static void draw_series_line(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) { ... 此处省略一堆代码 if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { lv_draw_line(draw_ctx, &line_dsc_default, &p1, &p2); } //注释掉下面的 // if(point_w && point_h && ser->y_points[p_prev] != LV_CHART_POINT_NONE) { // lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); // } lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } } p_prev = p_act; } /*Draw the last point*/ if(!crowded_mode && i == chart->point_cnt) { if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { lv_area_t point_area; point_area.x1 = p2.x - point_w; point_area.x2 = p2.x + point_w; point_area.y1 = p2.y - point_h; point_area.y2 = p2.y + point_h; part_draw_dsc.id = i - 1; part_draw_dsc.p1 = NULL; part_draw_dsc.p2 = NULL; part_draw_dsc.draw_area = &point_area; part_draw_dsc.value = ser->y_points[p_act]; lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); //注释掉下面的 //lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } } } draw_ctx->clip_area = clip_area_ori; }
- 随机文章
- 热门文章
- 热评文章
- c#md5与SHA1验证函数
- UDP穿透NAT的原理与实现(UDP“打洞”原理)
- Linux下python2.7安装pip
- C#修改图片分辨率
- ESP8266在Eclipse下设置编译模式(有boot和无boot)
- 物联网 WIFI 一键配置原理(smartconfig) ESP8266/QCA4004
- HTTP请求头详解
- 锂电池充电的原理