Skip to content
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

chart.clear() 方法能否带上 delete chart.options.filters; chart.view=[]; #3936

Closed
jefferyssy opened this issue May 23, 2022 · 3 comments

Comments

@jefferyssy
Copy link

当前 chart.clear();
没有删除由于图例产生的筛选功能。

再次 chart.render();
上一轮的 option.filters 还存在,导致图例异常

@hustcc
Copy link
Member

hustcc commented May 23, 2022

应该可以 chart.filter(null) 清空之前的。

@jefferyssy
Copy link
Author

应该可以 chart.filter(null) 清空之前的。

亲 我试了下不行,看了下代码,必须要 chart.filter("字段key", null ),才行。

但是也不方便,如果我是可配置形的图标,不确定使用的筛选的key的什么了。

我想问下,在调用 chart.clear 的时候,能否清除画板的所有状态,这样绘制新图形的话,就不会受上次图形的影响了

@hustcc
Copy link
Member

hustcc commented Jun 22, 2022

chart.clear 目前不会清除 filter 信息,因为 clear 只是清除绘图元素,实际上的数据过滤操作还是保留的。所以如果你业务需求是 clear 的时候,需要把数据也还原,那么建议手动操作。[鞠躬]

@hustcc hustcc closed this as completed Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants