Don't try to show xhair if no active plot

symbol_search
Tyler Goodlet 2021-05-20 16:10:42 -04:00
parent 307afb1935
commit 212882a5a5
2 changed files with 7 additions and 1 deletions

View File

@ -172,6 +172,7 @@ class ChartSpace(QtGui.QWidget):
# XXX: pretty sure we don't need this # XXX: pretty sure we don't need this
# remove any existing plots? # remove any existing plots?
# XXX: ahh we might want to support cache unloading..
# self.vbox.removeWidget(self.linkedcharts) # self.vbox.removeWidget(self.linkedcharts)
# switching to a new viewable chart # switching to a new viewable chart

View File

@ -435,7 +435,12 @@ class Cursor(pg.GraphicsObject):
self, self,
y_label_level: float = None, y_label_level: float = None,
) -> None: ) -> None:
g = self.graphics[self.active_plot]
plot = self.active_plot
if not plot:
return
g = self.graphics[plot]
# show horiz line and y-label # show horiz line and y-label
g['hl'].show() g['hl'].show()
g['vl'].show() g['vl'].show()