Home Forums Chart Support How can I get the current x-value of my mouse when it is over a line graph?

How can I get the current x-value of my mouse when it is over a line graph?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #15805

    ayy

    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?

    #15806

    ayy

    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.

    • This reply was modified 6 years, 8 months ago by ayy. Reason: typo
    #15808

    ayy

    I was able to work around this by making a listener for each chart separately.

    #15815

    @ayy,

    Glad, that you figured it out.

    _____________
    Indranil Deo,
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.