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

如何清除缓存(饼图为例,最新数据为空时,保留上次图表内容) #32

Closed
kinglongRen opened this issue Sep 29, 2017 · 2 comments

Comments

@kinglongRen
Copy link

如何清除缓存(饼图为例,最新数据为空时,保留上次图表内容)
1)setOption以及将对应数据置空,仍然不能清除缓存;

@xieziyu
Copy link
Owner

xieziyu commented Sep 30, 2017

@kinglongRen 有两种方式:

  1. options为空的时候,利用*ngIf销毁echarts所在的DOM
  2. echarts提供clear()方法,所以在(chartInit)中获取到echarts实例后缓存下来,并在需要的时候,调用clear()方法。

@kinglongRen
Copy link
Author

采用echarts提供clear()方法,所以在(chartInit)中获取到echarts实例后缓存下来,并在需要的时候,调用clear()方法 问题解决

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