Clear ds line graphics on switch back to bars

big_data_lines
Tyler Goodlet 2022-03-24 13:29:45 -04:00
parent 2b12742992
commit 9b2ec871a0
1 changed files with 3 additions and 0 deletions

View File

@ -599,8 +599,10 @@ class BarItems(pg.GraphicsObject):
self._pi.removeItem(self) self._pi.removeItem(self)
curve, ds = self.get_ds_line(ds=0) curve, ds = self.get_ds_line(ds=0)
last_curve = self._ds_line last_curve = self._ds_line
assert last_curve is curve assert last_curve is curve
self._pi.addItem(curve) self._pi.addItem(curve)
curve.show() curve.show()
curve.update() curve.update()
@ -619,6 +621,7 @@ class BarItems(pg.GraphicsObject):
last_curve = self._ds_line last_curve = self._ds_line
assert last_curve is curve assert last_curve is curve
curve.hide() curve.hide()
curve.clear()
self._pi.removeItem(curve) self._pi.removeItem(curve)
# XXX: is this actually any faster? # XXX: is this actually any faster?