Narek-Khachikyan opened a new pull request, #21827:
URL: https://github.com/apache/echarts/pull/21827

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   Keep a second Y axis at -300 to 300 when recovering options, instead of 
narrowing it to the first axis's -100 to 100 range.
   
   ### Fixed issues
   
   Closes #21408.
   
   ## Details
   
   ### Before: What was the problem?
   
   A value-mode dataZoom shared by unequal axes writes its representative 
axis's calculated bounds into the option. Recovering that option then applies 
those bounds to every axis. A second axis configured for -300 to 300 becomes 
-100 to 100, clipping its line endpoints until a zoom action restores the range.
   
   This happens when creating a new chart from an unchanged `getOption()` 
result. It also explains the reporter's add-series case using full `notMerge` 
replacement.
   
   ![Before the fix, recovered charts and full series replacement narrow the 
second axis and clip both endpoints in SVG and 
Canvas.](https://raw.githubusercontent.com/Narek-Khachikyan/echarts/b218f45ab40b7d1e921ebcc51d364750a53d3962/evidence/before.png)
   
   ### After: How does it behave after the fixing?
   
   Each value-mode boundary retains its accepted value input and effective 
range mode, so each target axis calculates its own window during recovery. 
Percentage-mode boundaries keep their calculated percent/value pair. Views 
continue to use the axis proxy's calculated windows.
   
   | Scenario | Second-axis range before | Second-axis range after |
   | --- | --- | --- |
   | Original chart | -300 to 300 | -300 to 300 |
   | New chart from unchanged `getOption()` | -100 to 100 | -300 to 300 |
   | Add series with full `notMerge` replacement | -100 to 100 | -300 to 300 |
   | Full percent-zoom control | -300 to 300 | -300 to 300 |
   
   ![After the fix, original and recovered charts retain the second axis's full 
range and visible endpoints in SVG and 
Canvas.](https://raw.githubusercontent.com/Narek-Khachikyan/echarts/b218f45ab40b7d1e921ebcc51d364750a53d3962/evidence/after.png)
   
   The screenshots are actual Chromium SVG and Canvas captures from fresh 
baseline and fixed builds. [The evidence description and 
hashes](https://github.com/Narek-Khachikyan/echarts/blob/b218f45ab40b7d1e921ebcc51d364750a53d3962/README.md)
 identify both builds.
   
   There is a visible compatibility change in `getOption()`: value-mode 
boundaries retain the accepted raw value, including date strings and values 
outside the representative axis's extent, rather than that axis's calculated or 
clamped value. The corresponding percentage is `null`. Unspecified value 
boundaries stay unspecified. Existing `rangeMode` records the effective mode 
after actions. No public option or API is added.
   
   The [getOption 
documentation](https://echarts.apache.org/en/api.html#echartsInstance.getOption)
 supports recovering an identical new instance. It also discourages modifying 
and reapplying the full result for partial updates; that advice still applies. 
The unchanged recovery case fails independently of the reporter's update 
pattern.
   
   ## Document Info
   
   - [ ] This PR doesn't relate to document changes
   - [x] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   The existing `getOption()` and dataZoom guidance should clarify the 
value-mode output described above. There is no new option to document.
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   - `test/ut/spec/component/dataZoom/rangeRoundTrip.test.ts` adds seven 
regressions for repeated recovery, full series replacement, swapped axes, 
explicit bounds beyond the representative extent, percent actions, mixed modes 
and value actions. The baseline fails five cases and passes two controls; the 
fix passes all seven.
   - `test/dataZoom-range-recovery.html` uses local assets and charts no wider 
than 800px. It includes instructions and controls for recovery, adding a series 
and percent zoom.
   - `test/dataZoom-action.html` checks accepted `getOption()` inputs 
separately from calculated windows. Its time-range expectations reconstruct the 
exact dispatched calendar inputs at native local midnight.
   
   Local validation passed with the unchanged runtime and unit-test bytes: all 
201 unit tests in 27 suites, uncached lint, types, headers, release build and 
the declaration matrix. The final manual-test commit also passed the normal 
lint/type hooks. All 39 manual buttons passed in Canvas and SVG across 
Asia/Yerevan, UTC and America/New_York, for 768 assertions. No comparison 
tolerance or skip was changed.
   
   Browser checks covered the reduced recovery case, the reporter's add-series 
handler and the final HTML fixture in Chromium 157.0.8103.38. The full 
historical visual test suite, Firefox/WebKit, real pointer-wheel interaction 
and performance benchmarks were not run.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   This description was generated and posted by an AI agent.
   


-- 
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