// line displayed, calculate distance to line segments:
QVector<QPointF>lineData;
getLines(&lineData,QCPDataRange(0,dataCount()));// don't limit data range further since with sharp data spikes, line segments may be closer to test point than segments with closer key coordinate