JBorgia opened a new issue, #21649:
URL: https://github.com/apache/echarts/issues/21649

   ### 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
   
   
https://codepen.io/editor/CounterReset/pen/019ecd8b-19da-7e8c-9287-df1ee1aa1e75
   
   ### Steps to Reproduce
   
   1. xAxis: { type: 'time' }, dataZoom: [{ type: 'slider', showDataShadow: 
true }].
   2. Give the shadow-source series a SINGLE data point.
   3. 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.
   
   <img width="1360" height="840" alt="Image" 
src="https://github.com/user-attachments/assets/6499175e-842f-4989-b929-1d5740d6d74b";
 />
   <img width="1360" height="840" alt="Image" 
src="https://github.com/user-attachments/assets/d8d00bcc-0013-485b-b29d-460889011418";
 />
   
   ### 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
   
   ```markdown
   - 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.
   
   Screenshots:
   - Failure mode (shadow driven by sparse series):
     
https://github.com/user-attachments/assets/ef310709-4fbd-42e5-bb1f-e68e7efdb33a
   - Expected overview behavior (comparison):
     
https://github.com/user-attachments/assets/a0ece1cd-1d7a-4698-a80b-83d22f0dafc9
   
   The slider's data shadow is empty on 6.x. Switch the CDN to echarts/5.6.0 
and the shadow appears — same option.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to