Maybe it has bug in draw chart line data

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 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

hi, may it exists bug in draw chart series line.
in lv_chart.c file and the func draw_series_line, the 890 line code p2.x = ((w * i) / (chart->point_cnt - 1)) + x_ofs; it required point_cnt should not equal to 1, however, in func lv_chart_set_point_count, the 110 line code if(cnt < 1) cnt = 1;, it may be set 1.

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

What LVGL version are you using?

8.0.1

What do you want to achieve?

What have you tried so far?

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

If possible, add screenshots and/or videos about the current state.

Looks like a valid bug.

@kisvegabor Since, by definition, there need to be at least 2 points to draw the lines, I think it would make the most sense to just bail out of draw_series_line if chart->point_cnt <= 1. Do you agree?

I agree and pushed a fix.