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拖动结束事件和获取拖动后的最小值和最大值 #4172

Closed
chicAboo opened this issue Sep 25, 2022 · 1 comment

Comments

@chicAboo
Copy link

问题1描述:有没有slider拖动结束后的事件?
现状:
chart.on('slider:valuechanged', (e: any) => {
console.log('drop', e.gEvent.target.cfg.timeline.current, e);
});
现在使用valuechanged触发,每次改变都要触发一次,拖动结束后会执行多次回调,不满足需求;
希望:希望有一个slider拖动结束后的事件。

问题2描述:slider拖动事件结束后,怎么获取当前slider的最小值和最大值?

@hustcc
Copy link
Member

hustcc commented Dec 6, 2022

// ...
chart.render()

chart.getComponents().filter(c => c.type === 'slider')[0].component.on('sliderchange', (e) => {
  console.log('drop', e);
});

这样拿到的就是 slider 起止位置。对于问题 1,可以增加一个 debounce。

@hustcc hustcc closed this as completed Dec 6, 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