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] When the chart is configured with a scrollbar, events on the axis are triggered multiple times after scrolling is triggered #2336

Closed
kkxxkk2019 opened this issue Mar 7, 2024 · 0 comments · Fixed by #2341
Assignees
Labels
bug Something isn't working

Comments

@kkxxkk2019
Copy link
Collaborator

Version

lastest

Link to Minimal Reproduction

none

Steps to Reproduce

const spec = {
    type: 'bar',
    data: [
      {
        id: 'barData',
        values: [
          { year: '2000', sales: 22 },
          { year: '2001', sales: 13 },
          { year: '2002', sales: 25 },
          { year: '2003', sales: 29 },
          { year: '2004', sales: 38 },
          { year: '2005', sales: 49 },
          { year: '2006', sales: 58 },
          { year: '2007', sales: 29 },
          { year: '2008', sales: 78 },
          { year: '2009', sales: 19 },
          { year: '2010', sales: 23 },
          { year: '2011', sales: 20 },
          { year: '2012', sales: 98 },
          { year: '2013', sales: 49 },
          { year: '2014', sales: 28 }
        ]
      }
    ],
    direction: 'horizontal',
    yField: 'year',
    xField: 'sales',
    scrollBar: [
      {
        orient: 'right',
        startValue: '2011',
        endValue: '2014',
        roam: true
      }
    ]
  };
  // 两次动画
  // 滚动条不能再滚动条上拖拽
  const vchart = new VChart(spec, { dom: CONTAINER_ID });
  vchart.on('click', { level: 'model', type: 'axis' }, e => {
    console.log('===click');
  });
  vchart.renderSync();
  // Just for the convenience of console debugging, DO NOT COPY!
  window['vchart'] = vchart;

Current Behavior

触发滚动后,轴上的事件被触发多次

image

Expected Behavior

只触发一次

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@kkxxkk2019 kkxxkk2019 added the bug Something isn't working label Mar 7, 2024
@kkxxkk2019 kkxxkk2019 self-assigned this Mar 7, 2024
@kkxxkk2019 kkxxkk2019 mentioned this issue Mar 7, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant