[Bug] Regression in 6.x: dataZoom slider showDataShadow renders nothing when the shadow-source series has a single data point on a time axis (NaN from zero-width extent)
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
SliderZoomView._renderDataShadow から始め、リンクされている CodePen または単一ポイントの時間軸オプションで問題を再現します。6.x の動作を 5.6.0 と比較し、幅が 0 の extent と既存の step guard に注目します。単一ポイントのソースに対して data shadow が NaN 座標なしでレンダリングされ、複数の系列も引き続き正しく処理できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
Affected: 6.0.0 and 6.1.0 (latest). Regression — works in 5.x (tested 5.3.2 and 5.6.0). Introduced in 6.0.0 (the time-axis dataShadow positioning; first present in 6.0.0-beta.1).
Link to Minimal Reproduction
Steps to Reproduce
- xAxis: { type: 'time' }, dataZoom: [{ type: 'slider', showDataShadow: true }].
- Give the shadow-source series a SINGLE data point.
- The slider shadow is empty/missing.
Minimal option (the slider shadow vanishes on 6.x; renders on 5.x):
option = {
xAxis: { type: 'time' },
yAxis: { type: 'value' },
dataZoom: [{ type: 'slider', showDataShadow: true }],
series: [{ type: 'line', data: [['2025-07-01', 285]] }]
};
Real-world variant: with multiple series, the first eligible series is
chosen as the shadow source, so a single-point first series breaks the
shadow even when later series are dense.
Current Behavior
In SliderZoomView._renderDataShadow (6.x), the time-axis branch computes:
normalizationConstant = size[0] / (thisDataExtent[1] - thisDataExtent[0]);
thisCoord = isTimeAxis ? (value - thisDataExtent[0]) * normalizationConstant : thisCoord + step;
For a single-point series the x-extent has zero width, so
normalizationConstant = Infinity and thisCoord = 0 * Infinity = NaN. The
shadow polygon receives a NaN vertex and does not render.
Measured shadow polygon on 6.1.0: points [[size,0],[0,0],[NaN,15]] (hasNaN=true).
On 5.3.2/5.6.0 the same option yields finite, step-based points (hasNaN=false).
Note the adjacent step path WAS guarded against divide-by-zero
(Math.max(1, data.count() - 1)); the new time-axis division was not.
Expected Behavior
A single-point (zero-width-extent) shadow source should render the same way
it did in 5.x (no NaN), or fall back gracefully — not erase the shadow.
Fix: guard the time-axis normalization when (thisDataExtent[1] -
thisDataExtent[0]) === 0 (e.g. fall back to the step-based coordinate or
clamp to 0), mirroring the existing Math.max guard on step.
Happy to PR this.
Environment
- OS: macOS 15
- Browser: Chrome 126
- Framework: Angular
Any additional comments?
This is distinct from the timeline component — the issue is specifically
in the dataZoom-slider shadow source-series selection.
The slider's data shadow is empty on 6.x. Switch the CDN to echarts/5.6.0 and the shadow appears — same option.
- 主要言語
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
pollen-robotics/reachy-mini-desktop-app#341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mike-north/AgentMonitors#648 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/ui#700 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信