我有一个直方图类型的高图,我需要在图表事件更新函数中访问series[0].data以更改点颜色。我可以在谷歌开发工具中看到series[0].data包含我所有点的数组,但实际上在 JS 代码中得到一个空数组。点更新后颜色不变。示例:jsfiddle
1 回答

RISEBY
TA贡献1856条经验 获得超5个赞
没有这样的事件chart.events.update
。改用渲染 - API: https: //api.highcharts.com/highcharts/chart.events.render
演示: https: //jsfiddle.net/BlackLabel/csdnh6e3/
chart: {
events: {
render: function() {
console.log('data :', this.series[0].data);
this.series[0].data.forEach(data => data.update({
color: '#0f5'
}, false)); // after the update() color of points does not change
}
}
},
添加回答
举报
0/150
提交
取消