I want to highlight the graph that is drawn in plotcurve item on hovering.Here is the code

class PlotCurveItem(pg.PlotCurveItem):
def __init__(self, *args, **kargs):
pg.PlotCurveItem.__init__(self)

def hoverMoveEvent(self, event):
if self.path.contains(ev.pos()):
"""then highlight"""


But "contains" is getting satisfied even if I hover inside the plotCurve item.I want it to highlight only when i hover over the graph created by plotcurveitem. Is there any other solutions instead of using contains