Skip to content

Commit afbb2c2

Browse files
committed
now removes lines in the group aswell as emptying the _spark_list
1 parent 0439003 commit afbb2c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_display_shapes/sparkline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def __init__(
8989
) # self is a group of lines
9090

9191
def clear_values(self):
92-
self._spark_list = []
92+
"""Removes all values from the _spark_list list and removes all lines in the group"""
93+
94+
for _ in range(len(self)): # remove all items from the current group
95+
self.pop()
96+
self._spark_list = [] # empty the list
9397

9498
def add_value(self, value):
9599
"""Add a value to the sparkline.

0 commit comments

Comments
 (0)