[Mod] use partial update to improve plotting speed
This commit is contained in:
parent
585dedb314
commit
6b8bf824c6
@ -34,6 +34,9 @@ class ChartItem(pg.GraphicsObject):
|
||||
|
||||
self._rect_area: Tuple[float, float] = None
|
||||
|
||||
# Very important! Only redraw the visible part and improve speed a lot.
|
||||
self.setFlag(self.ItemUsesExtendedStyleOption)
|
||||
|
||||
@abstractmethod
|
||||
def _draw_bar_picture(self, ix: int, bar: BarData) -> QtGui.QPicture:
|
||||
"""
|
||||
|
@ -397,12 +397,7 @@ class ChartCursor(QtCore.QObject):
|
||||
"""
|
||||
Connect mouse move signal to update function.
|
||||
"""
|
||||
self._proxy = pg.SignalProxy(
|
||||
self._widget.scene().sigMouseMoved,
|
||||
delay=0.1,
|
||||
rateLimit=60,
|
||||
slot=self._mouse_moved
|
||||
)
|
||||
self._widget.scene().sigMouseMoved.connect(self._mouse_moved)
|
||||
|
||||
def _mouse_moved(self, evt: tuple) -> None:
|
||||
"""
|
||||
@ -412,7 +407,7 @@ class ChartCursor(QtCore.QObject):
|
||||
return
|
||||
|
||||
# First get current mouse point
|
||||
pos = evt[0]
|
||||
pos = evt
|
||||
|
||||
for plot_name, view in self._views.items():
|
||||
rect = view.sceneBoundingRect()
|
||||
|
Loading…
Reference in New Issue
Block a user