From 88d48bd188db42978836b1e7c130a6532790cb01 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 3 Jan 2021 11:10:08 -0500 Subject: [PATCH] Port to `Cursor` --- piker/ui/_chart.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 7d65d6c5..e8670c30 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -32,7 +32,7 @@ from ._axes import ( PriceAxis, ) from ._graphics._cursor import ( - CrossHair, + Cursor, ContentsLabel, ) from ._graphics._lines import ( @@ -186,7 +186,7 @@ class LinkedSplitCharts(QtGui.QWidget): def __init__(self): super().__init__() self.signals_visible: bool = False - self._ch: CrossHair = None # crosshair graphics + self._cursor: Cursor = None # crosshair graphics self.chart: ChartPlotWidget = None # main (ohlc) chart self.subplots: Dict[Tuple[str, ...], ChartPlotWidget] = {} @@ -234,7 +234,7 @@ class LinkedSplitCharts(QtGui.QWidget): self.digits = symbol.digits() # add crosshairs - self._ch = CrossHair( + self._cursor = Cursor( linkedsplitcharts=self, digits=self.digits ) @@ -246,7 +246,7 @@ class LinkedSplitCharts(QtGui.QWidget): _is_main=True, ) # add crosshair graphic - self.chart.addItem(self._ch) + self.chart.addItem(self._cursor) # axis placement if _xaxis_at == 'bottom': @@ -298,7 +298,7 @@ class LinkedSplitCharts(QtGui.QWidget): 'right': PriceAxis(linked_charts=self) }, viewBox=cv, - cursor=self._ch, + cursor=self._cursor, **cpw_kwargs, ) @@ -317,7 +317,7 @@ class LinkedSplitCharts(QtGui.QWidget): cpw.setXLink(self.chart) # add to cross-hair's known plots - self._ch.add_plot(cpw) + self._cursor.add_plot(cpw) # draw curve graphics if style == 'bar': @@ -368,7 +368,7 @@ class ChartPlotWidget(pg.PlotWidget): name: str, array: np.ndarray, static_yrange: Optional[Tuple[float, float]] = None, - cursor: Optional[CrossHair] = None, + cursor: Optional[Cursor] = None, **kwargs, ): """Configure chart display settings.