for(c=0; c < $scope.graphPlotsChunk.length; c++){
if(c == 0){
Plotly.newPlot(graphRender, [$scope.graphPlots2[c]], $scope.layout2);
}else{
setTimeout(function() {
$scope.testCounter.push(_.clone(c));
console.log($scope.testCounter);
Plotly.addTraces(graphRender, $scope.graphPlots2[c]);
},0);
}
}
调用Plotly addTraces抛出一个错误,因为unsyncroniced反“C”: setTimeout在代码角度破解位置?
没有超时的错误,但不会痕迹反映视图,直至循环结束。我希望看到的痕迹一个接一个地显示大数据绘图,可能会很慢,所以至少在代码运行时会发生一些变化
任何建议,不知道该从哪里下去!
http://community.plot.ly/t/update-view-after-every-iteration-plotly-js- addtraces-loop/1479/5 –
你尝试过'$ timeout()'吗? – theaccordance
不在这里,我会给它去 –