I have a chart with zoom. I want to add a vertical line that will follow the mouse along the graph, and display the values at the point for all the lines of the graph. Found an example d3.js v4, how do I have a line follow the mouse on hover, but also have a circle follow the path?
But when combining with my chart the following problems:
- the line flickers or fades while moving the mouse
- the zoom does not work with the mouse wheel (only works when the mouse is in motion)
I understand that the problem is likely that when the cursor moves, it pulls a line, and is called mouseleave
event for the zoom
element.
I tried to move the line several pixels to the left or to the right, but this is not what I want, and it still does not work correctly.
I tried to create a line not in the mouseG
element, as in the example, but on my own zoom
element. The line is no longer displayed at all.
Here is my fiddle https://jsfiddle.net/zkdxrtuc/8/