This is an automated email from the ASF dual-hosted git repository.

sushuang pushed a commit to branch PR/plainheart_fix/alignTicks-precision
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit d013d5e397b75b40a2e5a9588b701fb16ca927cf
Author: 100pah <[email protected]>
AuthorDate: Thu Jan 8 16:59:03 2026 +0800

    timeScale: Add the missing rounding (broken from a previous version) to 
time scale.
---
 src/scale/Time.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/scale/Time.ts b/src/scale/Time.ts
index a3a7de479..eb682440c 100644
--- a/src/scale/Time.ts
+++ b/src/scale/Time.ts
@@ -306,8 +306,8 @@ class TimeScale extends IntervalScale<TimeScaleSetting> {
     }
 
     parse(val: number | string | Date): number {
-        // val might be float.
-        return isNumber(val) ? val : +numberUtil.parseDate(val);
+        // `val` might be a float (e.g., calculated from percent), so call 
`round`.
+        return isNumber(val) ? Math.round(val) : +numberUtil.parseDate(val);
     }
 
     contain(val: number): boolean {


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

Reply via email to