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

Bug!! DataZoom #894

Closed
huyinghuan opened this issue Nov 14, 2014 · 3 comments
Closed

Bug!! DataZoom #894

huyinghuan opened this issue Nov 14, 2014 · 3 comments

Comments

@huyinghuan
Copy link

问题描述:
重载数据 调用setOption, option中的DataZoom 的end属性已修改,但是图上的缩放轴还是处于上一次数据的缩放(star,end)还是上一次的。

问题重现:http://plnkr.co/edit/BxlfH4qmbE3fCFZ4ZWHK?p=preview

@yangyuantianming
Copy link

目测要用absoluteZoom才有用.

@kener
Copy link
Contributor

kener commented Nov 17, 2014

楼上正解,dataZoom和dataRange以及Legend在多次setOption时都不会被复位或重新读取用户新的非样式属性,因为如timeline切换时一样,是为了保持用户当前查看时的交互状态。
如需实现你要的功能,可以直接使用组件实例的接口,如楼上说的。
但我们更建议你还是习惯setOption就好,数据驱动是用echarts最好的习惯。只在setOption前加一句就好了:
var setZoom = function(zoom){
options.dataZoom.end = zoom;
chart.clear(); // this!!!
chart.setOption(options)
}

@huyinghuan
Copy link
Author

恩。谢谢。 后面我自己找了下api,也发现了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

3 participants