Closed teepaja closed 4 years ago
After upgrading to 1.10 (and chart.js 2.9.3):
- "chart.js": "^2.8.0", - "chartjs-plugin-dragdata": "^1.0.4", + "chart.js": "^2.9.3", + "chartjs-plugin-dragdata": "^1.1.0", "react-chartjs-2": "^2.8.0",
I'm getting value as undefined with onDragEnd:
onDragEnd: (e: any, datasetIndex: any, index: any, value: any) => console.log(index, datasetIndex, value) ... >> 1, 0, undefined // This issue can be circumvented by getting the value from the dataset onDragEnd: (e: any, datasetIndex: any, index: any, value: any) => console.log(index, datasetIndex, data.datasets[datasetIndex].data[index]) ... >> 1, 0, 123 <-- actual value
You can also see this behaviour in the console of the example fiddle: https://jsfiddle.net/3v9kexbh/
Sorry, that was a bug introduced with the new applyMagnet feature. Thanks for reporting! Should be fixed by the new version 1.1.1
applyMagnet
1.1.1
After upgrading to 1.10 (and chart.js 2.9.3):
I'm getting value as undefined with onDragEnd:
You can also see this behaviour in the console of the example fiddle: https://jsfiddle.net/3v9kexbh/