Home › forums › Using CanvasJS › Draggable point
Tagged: drag and drop, mouse event
This topic contains 1 reply, has 1 voice, and was last updated by Razorblade 5 years ago.
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?
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 :)
You must be logged in to reply to this topic.