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

timelinechanged事件currentIndex问题 #4161

Closed
fallowu opened this Issue Sep 28, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@fallowu

fallowu commented Sep 28, 2016

问题简述 (One-line summary)

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.2.3
  • 浏览器类型和版本 (Browser version):Chrome 51.0
  • 操作系统类型和版本 (OS Version): WINDOWS 10

重现步骤 (Steps to reproduce)

1.官方实例http://echarts.baidu.com/gallery/editor.html?c=doc-example/mix-timeline-all
2.添加时间轴timelinechanged事件监听
3.自动播放和点击时间点。
4.使用左右切换按钮

期望结果 (Expected behaviour)

currentIndex结果都为0-9,
实际结果为:
自动播放时为10,1,2,3,4,...,9
点击时间点时为,0,1,2,3,...,9
使用左切换按钮时为:-1,0,1,2,...,8
1

可能哪里有问题 (What went wrong)

            _changeTimeline: function (nextIndex) {
                var currentIndex = this.model.getCurrentIndex();

                if (nextIndex === '+') {
                    nextIndex = currentIndex + 1;
                }
                else if (nextIndex === '-') {
                    nextIndex = currentIndex - 1;
                }

                this.api.dispatchAction({
                    type: 'timelineChange',
                    currentIndex: nextIndex,
                    from: this.uid
                });
            }

ECharts配置项 (ECharts option)

option = {

}

其他信息 (Other comments)

1

@100pah 100pah closed this in 0e684a7 Sep 30, 2016

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