Home forums Using CanvasJS Draggable point

This topic contains 1 reply, has 1 voice, and was last updated by  Razorblade 2 years, 3 months ago.

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

    Razorblade
    Participant

    Hello Everyone,
    is there any way to make a point on the chart draggable?

    I’m tring to figure out by myself using click and mousemove events,
    but I didn’t found a method to get the new Y using a proportion between
    Y and datapoint.Y, I don’t think this could work because Y is the value
    that starts from the upper left corner of the canvas instead datapoint.Y starts from
    the chart bottom (correct me if I mistake).

    Anyone ever tried to achieve such task?

    Thanks

    #6895

    Razorblade
    Participant

    I did it using column chart type,
    using both click event to enable ‘edit mode’ and mousemove to increase/decrease the bar value,
    depending on the Y difference between the latest and current mouse position.

    Can see my solution here https://github.com/kaiohken1982/Chart

    Any advice on how to improve this solution are welcome 🙂

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

You must be logged in to reply to this topic.