Skip to content

Commit

Permalink
Merge pull request #72 from RetiredWizard/sparkline
Browse files Browse the repository at this point in the history
 multisparkline: call update_line with single line index rather than …
  • Loading branch information
FoamyGuy committed May 10, 2024
2 parents f90a7cb + f07b60e commit 2742ae5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions adafruit_display_shapes/multisparkline.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,8 @@ def add_values(self, values: List[float], update: bool = True) -> None:
call the update()-method
"""

lines_to_update = []
for i, value in enumerate(values):
if value is not None:
lines_to_update.append(i)
top = self.y_tops[i]
bottom = self.y_bottoms[i]
if (
Expand All @@ -197,8 +195,8 @@ def add_values(self, values: List[float], update: bool = True) -> None:
self.y_tops[i] = top
self.y_bottoms[i] = bottom

if update and lines_to_update:
self.update_line(lines_to_update)
if update:
self.update_line(i)

def _add_point(
self,
Expand Down

0 comments on commit 2742ae5

Please sign in to comment.