使用setData可以解决这个问题。
ngOnInit() {
console.log(this.Highcharts_bt);
this.rate_bt = this.subject_bt.pipe(
concatMap(item => of (item).pipe(delay(0)))
).subscribe(data => {
this.rate_bt = data;
let curr_rate = Number(this.rate_bt.bitcoin);
this.chardata_bt.push(curr_rate);
let a_chart = this.Highcharts_bt.charts[0];
if (a_chart) {
a_chart.series[0].setData(this.chardata_bt, true);
}
});
}