Justin-ZS opened a new pull request, #20838: URL: https://github.com/apache/echarts/pull/20838
<!-- Please fill in the following information to help us review your PR more efficiently. --> ## Brief Information This pull request is in the type of: - [ ] bug fixing - [x] new feature - [ ] others ### What does this PR do? <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. --> Add `dataMin` and `dataMax` properties for value axes to extend the axis range while preserving nice scale algorithm. ### Fixed issues <!-- - #xxxx: ... --> - #20770 ## Details ### Before: What was the problem? <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. --> Currently, ECharts provides two ways to set axis range: 1. Let ECharts auto-calculate nice values by default 1. Use `min`/`max` to set fixed values, but this disables the nice scale algorithm There was no way to ensure a specific data point would be included in the axis range while still benefiting from the nice scale algorithm. <!-- ADD SCREENSHOT HERE IF APPLICABLE. --> ### After: How does it behave after the fixing? <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. --> With the new `dataMin`/`dataMax` properties, users can: - Specify values that should be included in the axis range - Only affect the range if the specified value extends beyond the actual data range - Still benefit from ECharts' nice scale algorithm for rounding values These properties are only effective for value axes (`value`, `log`) and have no effect on category axes. <!-- ADD SCREENSHOT HERE IF APPLICABLE. --> ## Document Info One of the following should be checked. - [ ] 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 ## Misc ### ZRender Changes - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx). ### Related test cases or examples to use the new APIs Test cases have been included in `test/axis-data-min-max.html` to verify different scenarios including: - Basic usage with standard value axes - Scenarios with negative values - Usage with log axes - Verification that they don't affect category axes ## Others ### Merging options - [ ] Please squash the commits into a single one when merging. ### Other information -- 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]
