How to dynamic update series ?
tried variant 1
componentDidUpdate(prevProps) {
if (this.props.data.series !== prevProps.data.series && this.chart !== null) {
this.chart.options.baseTime = this.props.data.baseTime;
this.chart.options.series = this.props.data.series;
this.chart.update();
}
}
tried variant 2
componentDidUpdate(prevProps) {
if (this.props.data.series !== prevProps.data.series && this.chart !== null) {
this.chart.options.series = [];
this.chart.update();
this.chart.options.baseTime = this.props.data.baseTime;
this.chart.options.series = this.props.data.series;
this.chart.update();
}
}
This examples duplicate series. Should it be completely destroyed ?
How to dynamic update series ?
tried variant 1
tried variant 2
This examples duplicate series. Should it be completely destroyed ?