Skip to content
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion adafruit_display_shapes/sparkline.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def __init__(
max_size=self._max_items - 1, x=x, y=y
) # self is a group of lines

def clear_values(self):
self._spark_list = []

def add_value(self, value):
"""Add a value to the sparkline.
:param value: The value to be added to the sparkline
Expand Down Expand Up @@ -116,7 +119,7 @@ def _xintercept(
horizontal_y - b
) / slope # calculate the x-intercept at position y=horizontalY
return int(xint)

def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top):

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