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: [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]