artus9033 / chartjs-plugin-dragdata

Draggable data points plugin for Chart.js
MIT License
261 stars 55 forks source link

How does dragX: true work? #47

Closed jiboncom closed 4 years ago

jiboncom commented 4 years ago

I have been trying adding the dragX: true property to the Line React Fiddle but I cannot get it working. Any idea? Would be nice adding an example with dragging in both directions, X and Y.

Thank you! Amazing plugin

chrispahm commented 4 years ago

Hi, dragging the x-axis in a line chart is not supported, you would need to convert your chart to scatter plot instead. See this issue for more information https://github.com/chrispahm/chartjs-plugin-dragdata/issues/9 As you just closed this I'm assuming you got it to work? If you did, you can leave a working fiddle/codepen for others that run into the same issue ;)

Best Christoph

chrispahm commented 4 years ago

For the sake of completeness: Here's a fiddle showing a line chart (technically a scatterplot) which can be dragged both along the x-, and y-axis:

https://jsfiddle.net/rqbcs6ep/1/

jiboncom commented 4 years ago

For the sake of completeness: Here's a fiddle showing a line chart (technically a scatterplot) which can be dragged both along the x-, and y-axis:

https://jsfiddle.net/rqbcs6ep/1/

That's much better that what I had done! I suggest you add it to the Example list! Very cool plugin.

jiboncom commented 4 years ago

And thank you very much for the fast response!

chrispahm commented 4 years ago

Good idea adding it to the list, will do!