Browse Source

Merge branch 'hightlight-datapoint-for-right-y-axis' into 'main'

fix Mouse move for right y series

See merge request chartwerk/line-pod!27
pull/3/head
Alexander Velikiy 2 years ago
parent
commit
517c014629
  1. 7
      src/index.ts

7
src/index.ts

@ -302,7 +302,12 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
this.hideCrosshairCircle(serie.idx); this.hideCrosshairCircle(serie.idx);
} else { } else {
const xPosition = this.state.xScale(closestDatapoint[0]); const xPosition = this.state.xScale(closestDatapoint[0]);
const yPosition = this.state.yScale(closestDatapoint[1]); let yPosition;
if(serie.yOrientation === yAxisOrientation.RIGHT) {
yPosition = this.state.y1Scale(closestDatapoint[1]);
} else {
yPosition = this.state.yScale(closestDatapoint[1]);
}
this.moveCrosshairCircle(xPosition, yPosition, serie.idx); this.moveCrosshairCircle(xPosition, yPosition, serie.idx);
} }

Loading…
Cancel
Save