|
40 | 40 |
|
41 | 41 | class Sparkline(displayio.Group):
|
42 | 42 | # pylint: disable=too-many-arguments
|
43 |
| - """ A sparkline graph. |
44 |
| -
|
45 |
| - : param width: Width of the sparkline graph in pixels |
46 |
| - : param height: Height of the sparkline graph in pixels |
47 |
| - : param max_items: Maximum number of values housed in the sparkline |
48 |
| - : param y_min: Lower range for the y-axis. Set to None for autorange. |
49 |
| - : param y_max: Upper range for the y-axis. Set to None for autorange. |
50 |
| - : param x: X-position on the screen, in pixels |
51 |
| - : param y: Y-position on the screen, in pixels |
52 |
| - : param color: Line color, the default value is 0xFFFFFF (WHITE) |
| 43 | + """A sparkline graph. |
| 44 | +
|
| 45 | + :param width: Width of the sparkline graph in pixels |
| 46 | + :param height: Height of the sparkline graph in pixels |
| 47 | + :param max_items: Maximum number of values housed in the sparkline |
| 48 | + :param y_min: Lower range for the y-axis. Set to None for autorange. |
| 49 | + :param y_max: Upper range for the y-axis. Set to None for autorange. |
| 50 | + :param x: X-position on the screen, in pixels |
| 51 | + :param y: Y-position on the screen, in pixels |
| 52 | + :param color: Line color, the default value is 0xFFFFFF (WHITE) |
53 | 53 | """
|
54 | 54 |
|
55 | 55 | def __init__(
|
@@ -86,8 +86,8 @@ def __init__(
|
86 | 86 | ) # self is a group of lines
|
87 | 87 |
|
88 | 88 | def add_value(self, value):
|
89 |
| - """ Add a value to the sparkline. |
90 |
| - : param value: The value to be added to the sparkline |
| 89 | + """Add a value to the sparkline. |
| 90 | + :param value: The value to be added to the sparkline |
91 | 91 | """
|
92 | 92 |
|
93 | 93 | if value is not None:
|
@@ -123,9 +123,7 @@ def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top):
|
123 | 123 | # pylint: disable= too-many-branches, too-many-nested-blocks
|
124 | 124 |
|
125 | 125 | def update(self):
|
126 |
| - """Update the drawing of the sparkline |
127 |
| -
|
128 |
| - """ |
| 126 | + """Update the drawing of the sparkline.""" |
129 | 127 |
|
130 | 128 | # get the y range
|
131 | 129 | if self.y_min is None:
|
@@ -212,7 +210,6 @@ def update(self):
|
212 | 210 | last_value = value # store value for the next iteration
|
213 | 211 |
|
214 | 212 | def values(self):
|
215 |
| - """Returns the values displayed on the sparkline |
216 |
| - """ |
| 213 | + """Returns the values displayed on the sparkline.""" |
217 | 214 |
|
218 | 215 | return self._spark_list
|
0 commit comments