[Bug] Legend click not responding when setOption is called at high frequency (≥30fps)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
更新間隔を1000/60に変更した後、dynamic-data2の例で失敗を再現します。まず、_downEl周辺におけるzrenderのmousedownおよびmouseupのクリック検出を追跡し、動作しているmousemoveの挙動と比較します。setOptionが高頻度で実行され続ける間、凡例のクリックが一貫してトリガーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
6.0.0
Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=dynamic-data2
Steps to Reproduce
Using the official https://echarts.apache.org/examples/zh/editor.html?c=dynamic-data2 example, change the update interval to 60fps:
setInterval(function () {
for (var i = 0; i < 5; i++) {
data.shift();
data.push(randomData());
}
myChart.setOption({
series: [{ data: data }]
});
}, 1000 / 60); // <-- changed from 1000 to 1000/60
// Add a legend:
option = {
legend: { data: ['Fake Data'] },
// ... rest unchanged
};
Steps to reproduce:
- Open the above config in ECharts playground
- Try clicking the legend item "Fake Data"
- Click multiple times — the legend rarely or never responds
Current Behavior
When setOption is called at high frequency (≥30fps, e.g. real-time WebSocket data),
clicking legend items becomes unreliable or completely unresponsive.
Expected Behavior
Legend items should be clickable regardless of how frequently setOption is called.
Environment
- OS: macOS 26.3.1、Windows 10
- Browser: Chrome Version 146.0.7680.165 (Official Build) (arm64)
- Framework: Vue3、Chrome officel example
Any additional comments?
Root Cause (suspected)
zrender's click detection saves _downEl on mousedown and compares it to the
element found at mouseup. When setOption triggers a scene graph update between
mousedown and mouseup, the legend elements may be recreated or marked dirty,
causing the reference comparison to fail and the click event to never fire.
This does not happen with mousemove (cursor change works correctly), only with
the mousedown → mouseup sequence.
Temporary solution
Replace ECharts' built-in legend with HTML elements positioned over the canvas,
and use dispatchAction({ type: 'legendToggleSelect', name }) to control
series visibility programmatically.
- 主要言語
- TypeScript
- スター
- 67.7k
- フォーク
- 19.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/echarts のほかの issue
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edge対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンen pending
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrect対応中かも @waterWang が 98 日前に担当しました。 オープンbug en pending
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
Stop retrying permanent GitHub API failures in retry.sh対応中かも @muspi-merol-review が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
promplate/code-review#113 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
サムネイルの Storage のバケット(`thumbnails`)に、大きさの上限(1 MiB)と許可する種類(JPEG、PNG、WebP)を設定する対応中かも @ykzts が今日担当しました。 オープンtech: supabase
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
inabagumi/shinju-date#7147 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elecnix/your-attention#129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
umami-software/umami#4780 ·
メンテナーはふだん 3 日以内に返信