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

柱状图一点就消失了 #15

Closed
houcz9 opened this issue Jun 21, 2018 · 6 comments
Closed

柱状图一点就消失了 #15

houcz9 opened this issue Jun 21, 2018 · 6 comments

Comments

@houcz9
Copy link

houcz9 commented Jun 21, 2018

柱状图一点就消失了,再点击出来了,经常闪烁

@F-loat
Copy link
Owner

F-loat commented Jun 21, 2018

原库就有这个问题,我再排查下,不行就得等他们更新了 ecomfe#218

@houcz9
Copy link
Author

houcz9 commented Jun 21, 2018

disableTouch=false禁用了触摸事件好了

@F-loat
Copy link
Owner

F-loat commented Jun 21, 2018

和触摸事件肯定是有关,但是也不能直接禁用了

@F-loat
Copy link
Owner

F-loat commented Jun 21, 2018

touchmove 事件做了去抖处理后基本不会出现那个问题了,你可以试下效果

// src/echarts.vue
touchMove(e) {
  if (!this.disableTouch && chart && e.mp.touches.length > 0) {
    const touch = e.mp.touches[0];
    if (this.timer) clearTimeout(this.timer);
    this.timer = setTimeout(() => {
      chart._zr.handler.dispatch('mousemove', {
        zrX: touch.x,
        zrY: touch.y,
      });
      console.log(touch.x, touch.y)
    }, 30)
  }
},

@F-loat F-loat closed this as completed in 426ba55 Jun 21, 2018
@F-loat
Copy link
Owner

F-loat commented Jun 21, 2018

更新最新版(v0.2.5)后,给柱状图设置 throttleTouch 属性即可

<mpvue-echarts :echarts="echarts" :onInit="onInit" throttleTouch />

@houcz9
Copy link
Author

houcz9 commented Jun 22, 2018

ok,多谢

This issue was closed.
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