File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,14 @@ def clear_values(self) -> None:
99
99
self .pop ()
100
100
self ._spark_list = [] # empty the list
101
101
102
- def add_value (self , value : float ) -> None :
102
+ def add_value (self , value : float , update : bool = True ) -> None :
103
103
"""Add a value to the sparkline.
104
104
:param value: The value to be added to the sparkline
105
+ :param update: trigger recreation of primitives
106
+
107
+ Note: when adding multiple values it is more efficient to call
108
+ this method with parameter 'update=False' and then to manually
109
+ call the update()-method
105
110
"""
106
111
107
112
if value is not None :
@@ -110,7 +115,8 @@ def add_value(self, value: float) -> None:
110
115
): # if list is full, remove the first item
111
116
self ._spark_list .pop (0 )
112
117
self ._spark_list .append (value )
113
- self .update ()
118
+ if update :
119
+ self .update ()
114
120
115
121
# pylint: disable=no-else-return
116
122
@staticmethod
You can’t perform that action at this time.
0 commit comments