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+
15# class of sparklines in CircuitPython
2- # created by Kevin Matocha - Copyright 2020 (C)
36
47# See the bottom for a code example using the `sparkline` Class.
58
3437
3538"""
3639
40+ #pylint: disable=too-many-instance-attributes
41+
3742import displayio
3843from adafruit_display_shapes .line import Line
3944
@@ -85,6 +90,13 @@ def __init__(
8590 max_size = self ._max_items - 1 , x = x , y = y
8691 ) # self is a group of lines
8792
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+
88100 def add_value (self , value ):
89101 """Add a value to the sparkline.
90102 :param value: The value to be added to the sparkline
You can’t perform that action at this time.
0 commit comments