Highcharts中的线条可以一个接一个地出现吗?(Can the lines in Highcharts appear one after the other?)

编程入门 行业动态 更新时间:2024-10-23 10:32:26
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/

更多推荐

本文发布于:2023-08-07 01:25:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1457839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线条   接一个   Highcharts   lines

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!