Skip to content

Commit b2aec7f

Browse files
committed
Address review remarks
1 parent fc7c4bd commit b2aec7f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

adafruit_display_shapes/multisparkline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(
141141
# y_bottom: The actual minimum value of the vertical scale, will be
142142
# updated if autorange
143143
self.y_tops = self.y_maxs.copy()
144-
# y_top: The actual minimum value of the vertical scale, will be
144+
# y_top: The actual maximum value of the vertical scale, will be
145145
# updated if autorange
146146
self._palette = displayio.Palette(self._lines + 1)
147147
self._palette.make_transparent(0)
@@ -194,7 +194,7 @@ def add_values(self, values: List[float], update: bool = True) -> None:
194194
self.y_bottoms[i] = bottom
195195

196196
if update:
197-
self.update(i)
197+
self.update_line(i)
198198

199199
@staticmethod
200200
def _xintercept(

adafruit_display_shapes/sparkline.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,17 @@ def values(self) -> List[float]:
104104
"""Returns the values displayed on the sparkline."""
105105

106106
return self.values_of(0)
107+
108+
@property
109+
def y_top(self) -> float:
110+
"""
111+
:return: The actual maximum value of the vertical scale, will be updated if autorange
112+
"""
113+
return self.y_tops[0]
114+
115+
@property
116+
def y_bottom(self) -> float:
117+
"""
118+
:return: The actual minimum value of the vertical scale, will be updated if autorange
119+
"""
120+
return self.y_bottoms[0]

0 commit comments

Comments
 (0)