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

ovilia pushed a commit to branch dvdkon-fix-13627
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 0c908241d8cf6ee2e3daf26c0582fae40061179f
Author: Ovilia <[email protected]>
AuthorDate: Fri May 10 14:53:21 2024 +0800

    fix: fix failed test cases and improve code
---
 src/coord/axisTickLabelBuilder.ts | 12 +-----------
 test/axis-customTicks.html        |  2 +-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/coord/axisTickLabelBuilder.ts 
b/src/coord/axisTickLabelBuilder.ts
index dcd9febd7..e7f7bbb08 100644
--- a/src/coord/axisTickLabelBuilder.ts
+++ b/src/coord/axisTickLabelBuilder.ts
@@ -61,17 +61,7 @@ type InnerStore = {
 const inner = makeInner<InnerStore, any>();
 
 function tickValuesToNumbers(axis: Axis, values: (number | string | Date)[]) {
-    const nums = values.map(val => {
-        if (zrUtil.isString(val)) {
-            return axis.model.get('data').indexOf(val);
-        }
-        else if (val instanceof Date) {
-            return val.getTime();
-        }
-        else {
-            return val;
-        }
-    });
+    const nums = zrUtil.map(values, val => axis.scale.parse(val));
     if (axis.type === 'time' && nums.length > 0) {
         // Time axis needs duplicate first/last tick (see TimeScale.getTicks())
         // The first and last tick/label don't get drawn
diff --git a/test/axis-customTicks.html b/test/axis-customTicks.html
index d11ec2972..24f9c7dc9 100644
--- a/test/axis-customTicks.html
+++ b/test/axis-customTicks.html
@@ -23,7 +23,7 @@ under the License.
     <head>
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1" />
-        <script src="lib/esl.js"></script>
+        <script src="lib/simpleRequire.js"></script>
         <script src="lib/config.js"></script>
         <script src="lib/jquery.min.js"></script>
         <script src="lib/facePrint.js"></script>


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

Reply via email to