问题
I need to set up a Highcharts chart of type "organization" which should support Drag & Drop the Nodes on each other (to move the nodes inside the tree).
Currently, I got an "organization" chart which displays all the needed information.
I tried to use the Highcharts.plotOptions.series.dragDrop
-Events but that wasn't working at all.
I also tried to use Highcharts.series[organization].dataLabels.nodeFormatter
-Callback to replace the outer div by a div with attributes: draggable="true" ondragstart="fun1(event)" ondrag="fun2(event)" ondrop="fun3(event)" ondragover="func(event)"
I just used the functions from w3schools:
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
But that wasn't working either. So now I am stuck.
回答1:
It seems that drag and drop is not implemented on Organizations chart type. You can read the thread in official highcharts forum or on github issues.
Follow the conversation on: Highcharts forum and Github issues
来源:https://stackoverflow.com/questions/59855200/how-can-i-enable-drag-drop-in-highcharts-organization-charts