Closed Sakura-gh closed 3 years ago
Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.
A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe our mailing list.
Have a nice day! 🍵
@Sakura-gh It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗
@Sakura-gh echarts 版本是多少呢?
以及, setOption(dataOption, ...)
的 dataOption
是什么内容。
@Sakura-gh echarts 版本是多少呢?
以及,
setOption(dataOption, ...)
的dataOption
是什么内容。
我发现自己使用的是echarts4.9.0版本,好像并不支持replaceMerge参数,以上的情况应该是直接发生了merge和替换
v5
后支持 replaceMerge ,能只清除 series 。
What problem does this feature solve?
使用this.chartInstance.clear()或this.chartInstance.setOption(..., true)都会把原先所有的内容给清空,尤其是在使用百度地图时,由于bmap属性被清除,导致所有自定义样式也会一同消失。如果使用上述两种方法,需要重新加载过多的资源,导致刷新卡顿。目前的需求是仅仅清空原option中的series属性,而不用清除其他属性导致重复加载。
注:我尝试过replaceMerge方法,在没有设置series属性id的情况下,replaceMerge似乎并不能完整地删除原有的series:
console输出: 原先的series:
setOption之后的series:
新的series只包含0: {type: "effectScatter", coordinateSystem: "bmap", animation: true, symbol: "circle", symbolSize: 15, …},显然这个结果是删除了原series中的0: {name: "飞线", type: "lines", coordinateSystem: "bmap", symbol: Array(2), effect: {…}, …},却保留了不应该保留的1: {name: "终点", type: "effectScatter", coordinateSystem: "bmap", rippleEffect: {…}, symbolSize: 10, …}
What does the proposed API look like?
chartInstance.clearSeries()