Highcharts中的线条可以一个接一个地出现吗?(Can the lines in Highcharts appear one after the other?)
我在Highcharts图中有多行,并希望它们一个接一个地出现,而不是同时出现。 那可能吗? 我这里有个小提琴 。
也许一种方法是首先显示没有行(如何?),然后使它们出现在另外一个函数中:
function(chart) { chart.series[0].drawLine({lineWidth: 1}), chart.series[1].drawLine({lineWidth: 1}), chart.series[2].drawLine({lineWidth: 1}); });然而,我却不知道让它们出现......对我来说有什么好吃的吗? 非常感谢!
I have multiple lines in a Highcharts graph, and would like to make them appear one after another, and not all at the same time. Is that possible? I have a fiddle here.
Perhaps one approach would be to display first no line at all (how?), and then make them appear in an additional function like:
function(chart) { chart.series[0].drawLine({lineWidth: 1}), chart.series[1].drawLine({lineWidth: 1}), chart.series[2].drawLine({lineWidth: 1}); });where I have however no idea to make them appear... Any tipp for me? Thanks so much!
最满意答案
您需要逐个调用addSeries ,即在setTimeout函数中。
setTimeout(function(){ chart.addSeries({ data: [1,2,3] }); setTimeout(function(){ chart.addSeries({ data: [2,3,4] }); },1000); },1000);简单演示:
http://jsfiddle.net/sdpxahcq/You need to call addSeries one by one, i.e in setTimeout function.
setTimeout(function(){ chart.addSeries({ data: [1,2,3] }); setTimeout(function(){ chart.addSeries({ data: [2,3,4] }); },1000); },1000);Simple demo:
http://jsfiddle.net/sdpxahcq/更多推荐
发布评论