Skip to content

Commit 7b3fe50

Browse files
authored
Merge pull request #895 from AlanFromJapan/fix/DisplayLineGraph_div_by_zero
2 parents 54713a8 + 5309094 commit 7b3fe50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/lcd/lcd_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,
420420

421421
step = width / len(values)
422422
# pre compute yScale multiplier value
423-
yScale = height / (max_value - min_value)
423+
yScale = (height / (max_value - min_value)) if (max_value - min_value) != 0 else 0
424424

425425
plotsX = []
426426
plotsY = []

0 commit comments

Comments
 (0)