fix: Fixed possible slice step is 0 when generate box profit diagram

This commit is contained in:
LWR 2024-11-11 23:02:53 +08:00
parent f92b4d7136
commit a7df9e58de

View File

@ -674,7 +674,7 @@ class LiveReportGenerator:
end = abs_max + (-abs_max % 10)
step = int((end - start) / 10)
yticks = list(range(start, end)[::step])
yticks = list(range(start, end)[::step]) if step != 0 else [0]
yticks.append(end)
return cls.__get_line_diagram(
indexs, profits, [], yticks, [], [], (-1, length), (start, end), width