如何启用拖放功能放弃Highcharts组织结构图? [英] How can i enable Drag & Drop in Highcharts organization-charts?

查看:62
本文介绍了如何启用拖放功能放弃Highcharts组织结构图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置类型为"organization"的Highcharts图表,该图表应支持Drag&相互放下节点(以在树内移动节点).

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.

我尝试使用 Highcharts.plotOptions.series.dragDrop -Events,但这根本没有用.我还尝试使用 Highcharts.series [organization] .dataLabels.nodeFormatter -Callback将div替换为具有以下属性的div: draggable ="true" ondragstart ="fun1(event)"ondrag =" fun2(event)"ondrop =" fun3(event)"ondragover =" func(event)"

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)"

我刚刚使用了w3schools的功能:

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.

推荐答案

似乎没有在 Organizations 图表类型上实现拖放.您可以在官方的highcharts论坛或github问题上阅读该线程.

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.

关注以下话题: Highcharts论坛 Github问题

这篇关于如何启用拖放功能放弃Highcharts组织结构图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆