You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/11/03 04:39:36 UTC

[GitHub] [echarts] pissang commented on a change in pull request #15998: fix(axis): only `value` has `scale` in cartesian

pissang commented on a change in pull request #15998:
URL: https://github.com/apache/echarts/pull/15998#discussion_r741614599



##########
File path: src/coord/cartesian/AxisModel.ts
##########
@@ -57,6 +57,16 @@ export class CartesianAxisModel extends ComponentModel<CartesianAxisOption>
     getCoordSysModel(): GridModel {
         return this.getReferringComponents('grid', SINGLE_REFERRING).models[0] as GridModel;
     }
+
+    getNeedCrossZero(): boolean {
+        const option = this.option;
+
+        if (option.type === 'value') {
+            return !option.scale;
+        }
+
+        return !axisDefault[option.type].scale;

Review comment:
       I'm not quite understand logic about this line.

##########
File path: src/coord/cartesian/AxisModel.ts
##########
@@ -57,6 +57,16 @@ export class CartesianAxisModel extends ComponentModel<CartesianAxisOption>
     getCoordSysModel(): GridModel {
         return this.getReferringComponents('grid', SINGLE_REFERRING).models[0] as GridModel;
     }
+
+    getNeedCrossZero(): boolean {
+        const option = this.option;
+
+        if (option.type === 'value') {
+            return !option.scale;
+        }
+
+        return !axisDefault[option.type].scale;

Review comment:
       Seems it means the option provided to developers shows it can be configurable. But actually it doesn't. 
   
   I think it's better to remove `scale` type definition and default values in `log`, `time`, `category` axis. And check if scale is `'interval'` in https://github.com/apache/echarts/blob/master/src/coord/scaleRawExtentInfo.ts#L99

##########
File path: src/coord/cartesian/AxisModel.ts
##########
@@ -57,6 +57,16 @@ export class CartesianAxisModel extends ComponentModel<CartesianAxisOption>
     getCoordSysModel(): GridModel {
         return this.getReferringComponents('grid', SINGLE_REFERRING).models[0] as GridModel;
     }
+
+    getNeedCrossZero(): boolean {
+        const option = this.option;
+
+        if (option.type === 'value') {
+            return !option.scale;
+        }
+
+        return !axisDefault[option.type].scale;

Review comment:
       I'm not quite understand logic about this line.




-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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