Closed icezerowjj closed 4 years ago
The onDragEnd callback passes the new value of what was dragged as the 4th parameter:
onDragEnd: function (e, datasetIndex, index, value) {
}
The onDragEnd callback passes the new value of what was dragged as the 4th parameter:
onDragEnd: function (e, datasetIndex, index, value) { }
Thanks! But I am using this thing in React JS. I will need to define a similar function in JSX I assume?
Well here's a working example in React: https://jsfiddle.net/ecb4rz5v/
In the chart options, right where you defined dragData: true
, you also define the onDragEnd
callback. Check out the example and observe the logs to the console after dragging a point.
Well here's a working example in React: https://jsfiddle.net/ecb4rz5v/
In the chart options, right where you defined
dragData: true
, you also define theonDragEnd
callback. Check out the example and observe the logs to the console after dragging a point.
Yeah, this is so amazing and I am exactly referring to this example here. I will figure that out myself and I do appreciate it.
Here's probably my last question as I didn't see the answer online yet. If my labels are not even like they go from values such as 1, 2, 3, 6, 12, 24, 48, 120 (months)... How should I adjust the intervals of them on the XAxes, please?
Hmm so you want to change the axis tick intervals? If so, here's a guide on how to do that: https://stackoverflow.com/questions/53523600/how-to-change-x-axis-interval-on-chart-js
Hmm so you want to change the axis tick intervals? If so, here's a guide on how to do that: https://stackoverflow.com/questions/53523600/how-to-change-x-axis-interval-on-chart-js
Thank you very much. This is really helpful!
Alright I will close this as resolved then!
This is such great work!
But I am just wondering if it is able to return the value of the points after the user makes the tweak on the graph.
Thanks