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

This topic contains 3 replies, has 2 voices, and was last updated by  Indranil Deo 2 months, 1 week ago.

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

    ayy
    Member

    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
    Member

    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 2 months, 1 week ago by  ayy. Reason: typo
    #15808

    ayy
    Member

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

    #15815

    Indranil Deo
    Member

    @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.