How can i enable Drag & Drop in Highcharts organization-charts?

送分小仙女□ 提交于 2020-01-30 11:56:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!