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

Uncaught Error: setOption should not be called during main process. #6281

Closed
jeffmobiles opened this issue Jul 26, 2017 · 7 comments
Closed

Comments

@jeffmobiles
Copy link

jeffmobiles commented Jul 26, 2017

One-line summary [问题简述]

同时新建N个chart实例, 然后数据都是获取后台的数据,
使用SetTimeout() 也会报错...

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.6.2
  • Browser version [浏览器类型和版本]: chrome 57.0.2987.133 (64-bit)
  • OS Version [操作系统类型和版本]: window 7 (64-bit)

Expected behaviour [期望结果]

如果一个页面同时创建N个实例,获取结果都是异步的,然后根据结果封装option.
再更新chart实例的时候不会报错.

ECharts option [ECharts配置项]

option = {

}

Other comments [其他信息]

@jeffmobiles
Copy link
Author

jeffmobiles commented Jul 26, 2017

有时发生上述异常,有时又不会出现异常。

同时会一起报这个异常。
Uncaught TypeError: Cannot read property 'getComponent' of undefined

@jeffmobiles
Copy link
Author

jeffmobiles commented Jul 26, 2017

当正在新健chart实例,更新option的时候,同时 鼠标移动到另外一个chart上面触发axisTrigger()的时候就会报这中错误。 1:a chart instance set option() ,2: mouse move b chart ,axisTrigger. 两个同时进行的时候。

@jeffmobiles
Copy link
Author

jeffmobiles commented Jul 26, 2017

鼠标移动的图表 是用connect 关联起来的。。。

@100pah
Copy link
Member

100pah commented Jul 26, 2017

我们尝试改善下这个问题。
改善之前的解决方式,是保证每个 chart 都进行过 setOption 后再调用 connect。

@jeffmobiles
Copy link
Author

jeffmobiles commented Jul 26, 2017

@100pah thanks. it run . 运行成功...

@zzh3319
Copy link

zzh3319 commented Oct 15, 2017

改善之前的解决方式,是保证每个 chart 都进行过 setOption 后再调用 connect。???connect是干嘛的?

到底解决了没?

@MantleFace
Copy link

MantleFace commented Aug 17, 2021

改善之前的解决方式,是保证每个 chart 都进行过 setOption 后再调用 connect。???connect是干嘛的?

到底解决了没? connect连接方法吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants