Skip to content

Commit 0439003

Browse files
committed
Function that clears the _spark_list list
1 parent aa23cad commit 0439003

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_display_shapes/sparkline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def __init__(
8888
max_size=self._max_items - 1, x=x, y=y
8989
) # self is a group of lines
9090

91+
def clear_values(self):
92+
self._spark_list = []
93+
9194
def add_value(self, value):
9295
"""Add a value to the sparkline.
9396
:param value: The value to be added to the sparkline
@@ -116,7 +119,7 @@ def _xintercept(
116119
horizontal_y - b
117120
) / slope # calculate the x-intercept at position y=horizontalY
118121
return int(xint)
119-
122+
120123
def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top):
121124

122125
y_2 = int(self.height * (y_top - value) / (y_top - y_bottom))

0 commit comments

Comments
 (0)