I’m trying to empty an echart chart. I tried adding "true" at the setOption method, but that resets all the other options in the chart. To make it work, I made a default option object, to load every time I need to empty the chart, but that messes with some of the fluent interactivity of the chart. Is there a way to remove ONLY the series?
echart.setOption({series: []}, true);
2
Answers
I got a solution by replacing all the current series to empty series one by one:
You can use the
replaceMerge
parameter of thesetOption
function. From the documentation:Therefore, the following will remove all series: