Home Forums Chart Support Having an onClick event on the entire chart

Having an onClick event on the entire chart

Viewing 3 posts - 1 through 3 (of 3 total)
  • #23159

    I have a small problem/query with CanvasJS.

    In my website, I am showing a video and a chart that contains relevant information concerning that same video. I would like to be able to click on the chart and seek to my video. To do that, I only need the X value (time in ms) of the click event to do the rest. Currently, I am showing about 10 area datasets with a shared tooltip that shows me the time as well.

    1) Do you think it’s possible to make a click event on the chart look into the tooltip and get the time from it?
    2) If not, what are my best options?

    #23174

    @daringdan,

    If the length of video (in seconds / milliseconds) matches with the range of axisX (in seconds / milliseconds), you can seek video based on clicked position – with the help of convertPixelToValue method. Please take a look at this JSFiddle.


    Vishwas R
    Team CanvasJS

    #23178

    That’s exactly what I needed. Thanks.

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

You must be logged in to reply to this topic.