gpt4 book ai didi

javascript - Highcharts 系列更新动画

转载 作者:数据小太阳 更新时间:2023-10-29 04:29:55 25 4
gpt4 key购买 nike

我可以更新蜘蛛图的数据值并使用此方法查看它的动画:

chart.series[i].setData(newSeries[i].data);

但是,由于蜘蛛图中的系列不仅包含数据,还包含其他字段,如

series: [{
name: 'Allocated Budget',
data: [43000, 19000, 60000, 35000, 17000, 10000],
pointPlacement: 'on'
}, {
name: 'Actual Spending',
data: [50000, 39000, 42000, 31000, 26000, 14000],
pointPlacement: 'on'
}]

连同数据一起,当我需要更改值 name: 'Actual Spending' 时,如何用动画更新系列?

因为,例如,如果我调用:

chart.series[i].update({series: newSeries[i] , name : newName}); 

不会有任何动画。

如果还是不清楚...嗯,有时候一个jsfiddle值得 100 个字。

最佳答案

更新name,然后用想要的动画设置data:

chart.series[0].update({name:'new title'});
chart.series[0].setData(newData);

See working fiddle.

关于javascript - Highcharts 系列更新动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29549969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com