Home › forums › Using CanvasJS › How can I get the current x-value of my mouse when it is over a line graph?
Tagged: axisX, hover, line graph, mouseover
I know how to get the x-value at a point on a graph and have it displayed in the toolTip. What I would like to do is be able to mouse over anywhere on a line graph canvas and be able to display the current x-value, whether or not there is a point there or not. This will not be displayed with toolTip, but instead with my own custom way.
How can I get the x-value of my mouse?
I figured out that I can use convertPixelToValue(). For some reason the mousemove event does not work with my charts, but will work in this jsfiddle: http://jsfiddle.net/8ntLjscz/ . Any ideas on what could cause the event to not trigger? I made sure to put the event after the chart creation.
I was able to work around this by making a listener for each chart separately.
Glad, that you figured it out.
You must be logged in to reply to this topic.