-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: echarts.clear() 该方法清空当前实例。使用该方法后调用 getOption 方法返回并不是空对象 #7959
Comments
请调用 |
dispose 不是注销实例么 |
而且调用该方法后,去调用实例会报错 |
你不是要注销实例?那“清空当前实例”是什么意思? |
不是注销实例,是需要去清空当前的option值。官网不是有提供一个clear的接口么,但是这个接口和文档http://echarts.baidu.com/api.html#echartsInstance.clear |
clear只清除了series ,跟文档有出入 |
请问这个问题什么时候 解决呢 |
This issue is labeled with Please have a look at How to debug ECharts if you'd like to give a try. 🤓 |
嗯,我看了下 issue 里提到 clear 方法实际上是调用了setOption({series:[]}),我以为改成setOption({}) 就可以解决,结果发现 setOption 方法好像也不符合期望
|
我的理解是, |
验证了一下,好像是这样的 |
我觉得,是不是应该修改一下文档。 |
文档已修改,谢谢各位的建议。 |
echartsAPI接口 echartsInstance 中的clear() 该方法作用是清空当前实例。但是使用该方法后调用 getOption 方法返回并不是空对象
One-line summary [问题简述]
例如:
var echartsLineOne = echarts.init(document.getElementById('echartsLineOne'));
echartsLineOne.clear();
console.log(echartsLineOne.getOption()); // 此处获取的对象不是空对象
Version & Environment [版本及环境]
Expected behaviour [期望结果]
修改接口
ECharts option [ECharts配置项]
Other comments [其他信息]
The text was updated successfully, but these errors were encountered: