plainheart opened a new pull request, #21752:
URL: https://github.com/apache/echarts/pull/21752
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
Fix that the mark line is not at the expected position due to precision loss
when it targets a specific axis value.
For example:
```ts
{
yAxis: 2.0156
}
```
Since `precision` defaults to `2`, the mark line above is rounded to `2.02`.
So it appears in an unexpected position and even disappears when `yAxis.min` is
`2.015`.
I think we should retrieve precision from the value rather than using the
default precision when it targets a specific axis value to ensure it is at the
expected position.
### Fixed issues
Fixes #21743
## Comparison
| Before | After |
| :----: | :----: |
| <img width="800" height="600" alt="Before"
src="https://github.com/user-attachments/assets/8645fb32-37ec-4c54-84ed-77b71f3c74d3"
/> | <img width="800" height="600" alt="After"
src="https://github.com/user-attachments/assets/f9738733-d58b-4237-bc77-db41034e2215"
/> |
## Document Info
One of the following should be checked.
- [x] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
## Misc
### Security Checking
- [ ] This PR uses security-sensitive Web APIs.
<!-- PLEASE CHECK IT AGAINST:
<https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors>
-->
### ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Related test cases or examples to use the new APIs
test/markLine-precision.html
### 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]