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

图表重绘时会重置slider的范围 #3427

Closed
1 task done
Otocolobus-manul opened this issue May 18, 2021 · 2 comments
Closed
1 task done

图表重绘时会重置slider的范围 #3427

Otocolobus-manul opened this issue May 18, 2021 · 2 comments
Assignees

Comments

@Otocolobus-manul
Copy link

Otocolobus-manul commented May 18, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://antv-g2.gitee.io/zh/examples/area/basic#area-large

Steps to reproduce

  1. 随意拖动slider范围
  2. 缩放浏览器窗口
  3. slider又回到初始范围
Environment Info
g2 4.1.16
System -
Browser -

在修改data时也会触发重绘遇到这个bug,在一些需要slider和data联动的场景中十分不便

@hustcc
Copy link
Member

hustcc commented May 19, 2021

目前这个问题确实不是很好解决,slider 的状态目前没有办法很好的存储起来。后续新版本解决,时间暂时给不出来~

@pearmini
Copy link
Member

pearmini commented Sep 6, 2023

这个需要自己通过 chart.on('slider:change',() => {}) 去存储状态,然后再重新渲染的时候,通过 chart.emit('slider:change', {}) 去设置状态,可以参考这个文档

@pearmini pearmini closed this as completed Sep 6, 2023
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

3 participants