-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Tested with python -m pyqtgraph.examples
--> GraphicsItems --> Scatter Plot
Changed:
g.ScatterPlotItem(size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120))
to:
g.ScatterPlotItem(size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120), hoverable=True)
or:
g.ScatterPlotItem(size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120), hoverable=True, tip='x: {x:.3g}\ny: {y:.3g}\ndata={data}'.format)
Expected behaviour: When hovering over the data points a tooltip should be shown.
Experienced behaviour: Tooltip is not shown.
Tested on:
0.12.2 on Windows
0.11.1 on Linux (Arch)
The respective code lies in ScatterPlotItem.py (l. 1224):
# Show information about hovered points in a tool tip
vb = self.getViewBox()
if vb is not None and self.opts['tip'] is not None:
cutoff = 3
tip = [self.opts['tip'](x=pt.pos().x(), y=pt.pos().y(), data=pt.data())
for pt in points[:cutoff]]
if len(points) > cutoff:
tip.append('({} others...)'.format(len(points) - cutoff))
print('\n\n'.join(tip)) # ADDED to TEST
vb.setToolTip('\n\n'.join(tip))
self.sigHovered.emit(self, points, ev)
The added line shows that the tip is created, but it is never shown.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels