Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions adafruit_display_shapes/sparkline.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

"""

# pylint: disable=too-many-instance-attributes

import displayio
from adafruit_display_shapes.line import Line

Expand Down Expand Up @@ -88,6 +90,13 @@ def __init__(
max_size=self._max_items - 1, x=x, y=y
) # self is a group of lines

def clear_values(self):
"""Removes all values from the _spark_list list and removes all lines in the group"""

for _ in range(len(self)): # remove all items from the current group
self.pop()
self._spark_list = [] # empty the list

def add_value(self, value):
"""Add a value to the sparkline.
:param value: The value to be added to the sparkline
Expand Down