Dynamic update series ?
- Dominant language
- TypeScript
- Stars
- 404
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
How to dynamic update series ?
tried variant 1
```js
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
```js
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 ?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.