You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2020/12/10 09:24:47 UTC

[incubator-echarts] 03/03: fix(axis): improve logic

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

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

commit e4f197a2cc4d2e2bb1f5c62c6084af6f80d201cd
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Dec 10 16:58:45 2020 +0800

    fix(axis): improve logic
---
 src/scale/Ordinal.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/scale/Ordinal.ts b/src/scale/Ordinal.ts
index 03f43ea..248c56d 100644
--- a/src/scale/Ordinal.ts
+++ b/src/scale/Ordinal.ts
@@ -67,7 +67,6 @@ class OrdinalScale extends Scale<OrdinalScaleSetting> {
             });
         }
         this._ordinalMeta = ordinalMeta as OrdinalMeta;
-        this._categorySortInfo = null;
         this._extent = this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];
     }
 
@@ -134,7 +133,9 @@ class OrdinalScale extends Scale<OrdinalScaleSetting> {
         const categorySortInfo = this._categorySortInfo;
         if (categorySortInfo) {
             // Sorted
-            return categorySortInfo[n] && categorySortInfo[n].beforeSortIndex;
+            return categorySortInfo[n]
+                ? categorySortInfo[n].beforeSortIndex
+                : -1;
         }
         else {
             // Not sorted


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org