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/10/14 04:13:54 UTC

[GitHub] [echarts] plainheart opened a new pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

plainheart opened a new pull request #15878:
URL: https://github.com/apache/echarts/pull/15878


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   In ECharts 5.x, the line/bar chart renders abnormally when `yAxis.max` is set to be a value less than the min value of the series data. See #14812 for more details.
   
   I'm not sure if the root cause was found. Related commit is b116faa8ad5db4a887d4b6c0f9a23ec52534f8f2 in PR #12832.
   
   ### Fixed issues
   
   - #14812
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   <img src="https://user-images.githubusercontent.com/26999792/137250234-99b9fbad-1570-4f7d-a16a-04e202eb21a4.png" width="400">
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   <img src="https://user-images.githubusercontent.com/26999792/137250297-5190d491-c3b0-4752-bd36-462454699a81.png" width="400">
   
   
   ## Misc
   
   <!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
   
   - [ ] The API has been changed (apache/echarts-doc#xxx).
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   Please refer to `test/axis-filter-extent2.html`
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   


-- 
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


[GitHub] [echarts] pissang commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r732407532



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       I think we can remove `NaN` logic here. Then think about how should we handling the case min/max is invalid.

##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       I think we can remove `NaN` logic here. Then think about how should we handle the case min/max is invalid.

##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       I think we can remove `NaN` logic here. Then think about how should we handle the case when min/max are invalid.




-- 
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


[GitHub] [echarts] plainheart commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r732378220



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       #15910 seems to state another potential enhancement where `min` is identical to `max`.




-- 
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


[GitHub] [echarts] pissang merged pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
pissang merged pull request #15878:
URL: https://github.com/apache/echarts/pull/15878


   


-- 
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


[GitHub] [echarts] pissang commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r728625823



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       This change looks good in the example. Are there any concerns at the time we adding this logic @100pah 




-- 
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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#issuecomment-952464791


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


-- 
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


[GitHub] [echarts] 100pah commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
100pah commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r732387853



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       Just consider that if `min` is set to be bigger than `max`, it does not make sense to display the chart.




-- 
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


[GitHub] [echarts] plainheart commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r732390177



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       I agree. But the `NaN` value brought an unexpected behavior.




-- 
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


[GitHub] [echarts] pissang commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r735226044



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       @100pah So should we merge this PR and keep improving in further PRs?




-- 
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


[GitHub] [echarts] plainheart commented on a change in pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#discussion_r732390177



##########
File path: src/coord/scaleRawExtentInfo.ts
##########
@@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
         (min == null || !isFinite(min)) && (min = NaN);
         (max == null || !isFinite(max)) && (max = NaN);
 
-        if (min > max) {
-            min = NaN;
-            max = NaN;

Review comment:
       I agree. But the `NaN` value brought an unexpected behavior. Maybe it's not a good idea to change here.




-- 
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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #15878: fix(axis): fix charts render abnormally when `yAxis.max` is set to be a value less than the min value of the series data.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #15878:
URL: https://github.com/apache/echarts/pull/15878#issuecomment-942930368


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.


-- 
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