我正在尝试使用多个任务更新任务甘特图,但是它不起作用
我尝试按照他们在这里所做的方式进行操作,但它仅适用于将一个里程碑更新到一个任务栏的情况,对于我来说,我有多个具有依赖性的任务
var chart;
chart = Highcharts.ganttChart('container', chartStructure);
var updatingGanttChartt = setInterval(function () {
$.ajax({
type: "GET",
url: myUrl,
cache: false,
success: function (response, textStatus, request) {
var chartDataInfo = JSON.parse(response);
var updatedChartData = JSON.parse(chartDataInfo.StructureAsJson);
for (var i = 0; i < chart.series[0].points.length; i++) {
var newData = updatedChartData.series[0].data[i];
newData.animate = true;
newData.marker = {};
newData.marker.symbol = null;
chart.series[0].points[i].graphic =
chart.series[0].points[i].graphic.destroy();
chart.series[0].points[i].update({
newData
});
}
if (chartDataInfo.PercentageComplete >= 100) {
clearInterval(updatingGanttChartt);
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.statusText);
}
});
}, 1000);