How can I implement an invert function for a point scale?
问题 I am trying to add a tooltip for my dual line chart graph. However, instead of using timeScale or scaleLinear, I used scalePoint to graph my chart. I am trying to achieve the following effect: https://bl.ocks.org/mbostock/3902569 this.x = d3.scalePoint().range([ this.margin.left, this.width - this.margin.right ]); this.xAxis = d3.axisBottom(this.x); this.x.domain( this.dataArray.map(d => { return this.format(d[ 'year' ]); })); Here is my mouseover function, function mousemove() { //d3.mouse