[Bug] Tooltip performance issue with multiple "line" series on Windows + Chromium

未关闭
#21,784 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

The payload names no source files, only the linked CodePen reproduction and the workaround options axisPointer.zlevel, axisPointer.triggerEmphasis and series.emphasis.disabled. Start by running the CodePen on Windows Chromium with a Performance profile to see where the time goes when the cursor moves over 2,000-point line series at 700 px. Done means the axis pointer tracks the cursor smoothly without the emphasis workaround, in both the Canvas and SVG renderers.

由索引模型根据 Issue 内容生成。

描述

bug en pending
Version

6.1.0

Link to Minimal Reproduction

https://codepen.io/kirchsuSICKAG/pen/PwpEBvV

Steps to Reproduce
  1. Use ECharts 6.1.0 with a current Chrome or Edge on Windows device.
  2. Create a line chart with tooltip.trigger: 'axis' and at least two line series, better visible on more.
  3. Use jagged data, such as independently generated random values between 0 and 100.
  4. Set the chart height to about 700 px and use 2,000 data points per series.
  5. Move the mouse across the plot area. Observe that the tooltip and axis pointer lag behind the cursor or move in visible jumps. The lag becomes worse as more line series are added.
  6. Repeat with tooltip: { trigger: 'axis', showContent: false }. The axis pointer still lags, so the issue is not limited to displaying the tooltip content.
  7. Repeat with DevTools open. The lag becomes more noticeable.
  8. For comparison, try a 300 px chart, one line series, gradual rather than jagged data, Firefox on Windows, or Chrome/Edge on macOS. These cases showed no lag in my tests.

For testing all this things out, have a look at my codepen example.

Current Behavior

When the mouse moves over the plot area, the tooltip and axis pointer visibly lag behind or jump instead of following the cursor smoothly, if using a Windows device in a chromium browser (Chrome / Edge). The lag is most noticeable the more jagged line series are used. It becomes more severe as the number of series, the chart height increases or the browser dev console is open.

The issue is reproducible with both the Canvas and SVG renderers. The axis pointer still lags when tooltip content is disabled with tooltip.showContent: false, so the issue is not limited to rendering the tooltip content.

In the tested configurations, the chart remained smooth with a 300 px height but lagged at 700 px. Jagged, abruptly changing data caused more lag than gradual data. Moving the series into separate value ranges did not eliminate the lag, so overlapping lines are not required to reproduce it. Opening DevTools makes the lag more noticeable.

The same chart was smooth in Firefox on Windows and in Chrome and Edge on macOS.

Workaround

In my reproduction, the lag is not reproducible by applying these options:

axisPointer: {
  zlevel: 10,
  triggerEmphasis: false
},
series: [{
  // ...
  emphasis: {
    disabled: true
  }
}]

### Expected Behavior

The tooltip and axis pointer should follow mouse movement smoothly across chart sizes and series counts for all browsers, without the need of disabling emphasis.

### Environment

```markdown
- OS:Windows
- Browser: Chrome and Edge
- Framework: all
Any additional comments?
Windows - Chrome

https://github.com/user-attachments/assets/8a19102a-48d3-4af5-8a2f-d5781501df83

Windows - Firefox

https://github.com/user-attachments/assets/bbdbf9b3-15ca-4f50-b90e-5dcce722fbd9

MAC - Chrome
Image
主要语言
TypeScript
星标
67.7k
派生
19.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/echarts 的其他 Issue

查看 apache/echarts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。