diff --git a/adafruit_display_shapes/sparkline.py b/adafruit_display_shapes/sparkline.py index a80e87a..83de076 100644 --- a/adafruit_display_shapes/sparkline.py +++ b/adafruit_display_shapes/sparkline.py @@ -40,16 +40,16 @@ class Sparkline(displayio.Group): # pylint: disable=too-many-arguments - """ A sparkline graph. - - : param width: Width of the sparkline graph in pixels - : param height: Height of the sparkline graph in pixels - : param max_items: Maximum number of values housed in the sparkline - : param y_min: Lower range for the y-axis. Set to None for autorange. - : param y_max: Upper range for the y-axis. Set to None for autorange. - : param x: X-position on the screen, in pixels - : param y: Y-position on the screen, in pixels - : param color: Line color, the default value is 0xFFFFFF (WHITE) + """A sparkline graph. + + :param width: Width of the sparkline graph in pixels + :param height: Height of the sparkline graph in pixels + :param max_items: Maximum number of values housed in the sparkline + :param y_min: Lower range for the y-axis. Set to None for autorange. + :param y_max: Upper range for the y-axis. Set to None for autorange. + :param x: X-position on the screen, in pixels + :param y: Y-position on the screen, in pixels + :param color: Line color, the default value is 0xFFFFFF (WHITE) """ def __init__( @@ -86,8 +86,8 @@ def __init__( ) # self is a group of lines def add_value(self, value): - """ Add a value to the sparkline. - : param value: The value to be added to the sparkline + """Add a value to the sparkline. + :param value: The value to be added to the sparkline """ if value is not None: @@ -123,9 +123,7 @@ def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top): # pylint: disable= too-many-branches, too-many-nested-blocks def update(self): - """Update the drawing of the sparkline - - """ + """Update the drawing of the sparkline.""" # get the y range if self.y_min is None: @@ -212,7 +210,6 @@ def update(self): last_value = value # store value for the next iteration def values(self): - """Returns the values displayed on the sparkline - """ + """Returns the values displayed on the sparkline.""" return self._spark_list diff --git a/examples/display_shapes_sparkline_ticks.py b/examples/display_shapes_sparkline_ticks.py index cdafbfb..59fe606 100755 --- a/examples/display_shapes_sparkline_ticks.py +++ b/examples/display_shapes_sparkline_ticks.py @@ -31,10 +31,11 @@ import board import displayio import terminalio +from adafruit_display_text import label from adafruit_display_shapes.sparkline import Sparkline from adafruit_display_shapes.line import Line from adafruit_display_shapes.rect import Rect -from adafruit_display_text import label + if "DISPLAY" not in dir(board): # Setup the LCD display with driver diff --git a/examples/display_shapes_sparkline_triple.py b/examples/display_shapes_sparkline_triple.py index f58a99d..ba8d774 100755 --- a/examples/display_shapes_sparkline_triple.py +++ b/examples/display_shapes_sparkline_triple.py @@ -31,8 +31,9 @@ import board import displayio import terminalio -from adafruit_display_shapes.sparkline import Sparkline from adafruit_display_text import label +from adafruit_display_shapes.sparkline import Sparkline + if "DISPLAY" not in dir(board): # Setup the LCD display with driver