File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-FileCopyrightText: 2020 Kevin Matocha
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+
1
5
# class of sparklines in CircuitPython
2
- # created by Kevin Matocha - Copyright 2020 (C)
3
6
4
7
# See the bottom for a code example using the `sparkline` Class.
5
8
34
37
35
38
"""
36
39
40
+ #pylint: disable=too-many-instance-attributes
41
+
37
42
import displayio
38
43
from adafruit_display_shapes .line import Line
39
44
@@ -85,6 +90,13 @@ def __init__(
85
90
max_size = self ._max_items - 1 , x = x , y = y
86
91
) # self is a group of lines
87
92
93
+ def clear_values (self ):
94
+ """Removes all values from the _spark_list list and removes all lines in the group"""
95
+
96
+ for _ in range (len (self )): # remove all items from the current group
97
+ self .pop ()
98
+ self ._spark_list = [] # empty the list
99
+
88
100
def add_value (self , value ):
89
101
"""Add a value to the sparkline.
90
102
:param value: The value to be added to the sparkline
You can’t perform that action at this time.
0 commit comments