Amcharts - sortable div 在滚动图表滚动条时移动

Amcharts - sortable div moves when chart scroll bar is scrolled

关于问题 , I realized using li won't work best for me & hence upon further research & following the example here, I've manged to implement a customized version of draggable div.
In the example (quoted in the answer of the question mentioned above), moving the scroll bar of the chart doesn't move the chart. However, implementing the charting by making the div that contains the chart draggable according to (link),尝试滚动滚动条移动 div 和图表。

在 (link) 中,我注释掉了 sortable 函数中的代码,因为我不需要它,这使得它看起来如下所示

$(function () {
    $(".grid").sortable({
        /*tolerance: 'pointer',
        revert: 'invalid',
        placeholder: 'span2 well placeholder tile',
        forceHelperSize: true*/
    });
});

此外,为了让图表在滚动时不移动,我尝试添加以下代码

$(function () {
    $(".grid").sortable({
        /*tolerance: 'pointer',
        revert: 'invalid',
        placeholder: 'span2 well placeholder tile',
        forceHelperSize: true*/
        cancel: ".amcharts-main-div"
    });
});
 $(". grid" ).disableSelection();

但是,添加 "cancel" & disableSelection() 会使图表无法移动。

这是棘手的情况。我能否请求一些关于组合这两个功能的指导,即使 div 可拖动以及当移动图表的滚动条时图表不应该移动?

这很简单。您唯一需要做的就是用 divs.

替换 <li> 标签

为了保持 运行 正确,您需要将 css 选择器 #sortable li 修改为 #sortable > div,因此它只会应用于第一级子 [=11] =],因此不会弄乱 AmCharts 内部 div。

这是修改后的 demo.