Override gl-chart default data merging logic
When updating gl-chart
( i.e. the underlying echart component ) data, the component merges new data with old data, rather than replacing it.
There is an API to change this behaviour by forcing it to replace new data (see notMerge
in https://echarts.apache.org/en/api.html#echartsInstance.setOption), but gl-chart
does not make use of that.
There is a workaround mentioned in a GH issue (https://github.com/apache/echarts/issues/6202) that suggests to set the data to null
first before updating, which forces the chart to replace the data rather then merging it. This can be seen in action here
Initially discussed in gitlab!148092 (merged)
Edited by Daniele Rossetti