|
|
|
@ -290,15 +290,14 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
|
|
|
|
|
let points = []; // datapoints in each metric that is closest to xValue/yValue position
|
|
|
|
|
this.series.visibleSeries.forEach((serie: LineTimeSerie) => { |
|
|
|
|
const closestDatapoint = this.getClosestDatapoint(serie, xValue, yValue); |
|
|
|
|
if(closestDatapoint === undefined) { |
|
|
|
|
if(_.isNil(closestDatapoint) || _.isNil(closestDatapoint[0])) { |
|
|
|
|
this.hideCrosshairCircle(serie.idx); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
const xPosition = this.state.xScale(closestDatapoint[0]); |
|
|
|
|
const yPosition = this.state.yScale(closestDatapoint[1]); |
|
|
|
|
this.moveCrosshairCircle(xPosition, yPosition, serie.idx); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const xPosition = this.state.xScale(closestDatapoint[0]); |
|
|
|
|
const yPosition = this.state.yScale(closestDatapoint[1]); |
|
|
|
|
this.moveCrosshairCircle(xPosition, yPosition, serie.idx); |
|
|
|
|
|
|
|
|
|
points.push({ |
|
|
|
|
value: closestDatapoint, |
|
|
|
|
color: serie.color, |
|
|
|
|