Home forums Using CanvasJS How to fetch x and y values from canvas chart

This topic contains 1 reply, has 2 voices, and was last updated by  Sanjoy 6 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #10124


    I have plotted a canvas chart from a csv file.
    Now I would like to fetch the data (x and y values) and print the values in a label when I hover on .

    I initially tried to pass the data from the API objet named ‘datapoints’ but the printed value of it was ‘[object Object]’

    I know that there is already a label which does that,(which presents a value when we hover on it) but I want to present that data in a custom label.

    Is it possible ? If yes, please guide me in how to proceed.



    Are you looking for mouseover event, where you can get the currently hover dataPoint’s x and y values like e.dataPoint.x and e.dataPoint.y. Or else you can look into toolTip contentFormatter.

    If this doesn’t suite your requirements, could you please provide us a pictorial representation to understand better.

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

You must be logged in to reply to this topic.