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/07/08 15:25:52 UTC

[GitHub] [echarts] susiwen8 opened a new pull request #15314: Fix(polar): polar would throw error if no label

susiwen8 opened a new pull request #15314:
URL: https://github.com/apache/echarts/pull/15314


   <!-- 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?
   
   Check existence of `label`
   
   
   
   ### Fixed issues
   
   Open `test/bar-background.html`, an error will throw
   <img width="622" alt="Screen Shot 2021-07-08 at 11 24 28 PM" src="https://user-images.githubusercontent.com/20318608/124948868-aaecac00-e043-11eb-9051-398d38ff3847.png">
   
   
   
   
   ## 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
   
   `test/bar-background.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 merged pull request #15314: Fix(polar): polar would throw error if no label

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


   


-- 
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 #15314: Fix(polar): polar would throw error if no label

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


   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] plainheart commented on a change in pull request #15314: Fix(polar): polar would throw error if no label

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



##########
File path: src/chart/bar/BarView.ts
##########
@@ -980,6 +980,11 @@ function updateStyle(
         }
     );
 
+    const label = el.getTextContent();
+    if (!label) {
+        return;
+    }
+
     if (isPolar) {
         const position = itemModel.get(['label', 'position']);
         el.textConfig.inside = position === 'middle' ? true : null;

Review comment:
       Some of the following logic still needs to be invoked, so we can't directly return here. 
   For example, https://github.com/apache/echarts/blob/6bd27bf3a0454abd68098ece9966ef2943543f19/src/chart/bar/BarView.ts#L1006-L1008
   It seems enough to put line 990 after the `setSectorTextRotation` function, in which has set the `textConfig`.
   https://github.com/apache/echarts/blob/6bd27bf3a0454abd68098ece9966ef2943543f19/src/chart/bar/BarView.ts#L990
   




-- 
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 edited a comment on pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878028687


   I found another issue that was brought in https://github.com/apache/echarts/pull/15182 that we can fix by hand.
   
   This `position` should be optional. https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42 


-- 
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] susiwen8 commented on pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
susiwen8 commented on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878294444


   > I found another issue that was brought in #15182. This `position` should be optional. https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42
   > 
   > Perhaps we can fix it by hand in this PR.
   
   @pissang Sure, done fix.


-- 
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 edited a comment on pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878028687


   I found another issue that was brought in https://github.com/apache/echarts/pull/15182.  This `position` should be optional. https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42 
   
   Perhaps we can fix it by hand.


-- 
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 #15314: Fix(polar): polar would throw error if no label

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



##########
File path: src/chart/bar/BarView.ts
##########
@@ -980,6 +980,11 @@ function updateStyle(
         }
     );
 
+    const label = el.getTextContent();
+    if (!label) {
+        return;
+    }
+
     if (isPolar) {
         const position = itemModel.get(['label', 'position']);
         el.textConfig.inside = position === 'middle' ? true : null;

Review comment:
       It seems enough to put line 990 after the `setSectorTextRotation` function, in which has set the `textConfig`.
   https://github.com/apache/echarts/blob/6bd27bf3a0454abd68098ece9966ef2943543f19/src/chart/bar/BarView.ts#L990
   




-- 
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 pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
pissang commented on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878028687


   I found another issue that brought in https://github.com/apache/echarts/pull/15182
   
   This `position` should be optional.
   https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42


-- 
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 edited a comment on pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878028687


   I found another issue that was brought in https://github.com/apache/echarts/pull/15182.  This `position` should be optional. https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42 
   
   Perhaps we can fix it by hand in this PR.


-- 
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 edited a comment on pull request #15314: Fix(polar): polar would throw error if no label

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #15314:
URL: https://github.com/apache/echarts/pull/15314#issuecomment-878028687


   I found another issue that was brought in https://github.com/apache/echarts/pull/15182. 
   
   This `position` should be optional. https://github.com/apache/echarts/blob/master/src/chart/bar/BarSeries.ts#L42 
   
   Perhaps we can fix it by hand.


-- 
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 #15314: Fix(polar): polar would throw error if no label

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


   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


[GitHub] [echarts] susiwen8 commented on a change in pull request #15314: Fix(polar): polar would throw error if no label

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



##########
File path: src/chart/bar/BarView.ts
##########
@@ -980,6 +980,11 @@ function updateStyle(
         }
     );
 
+    const label = el.getTextContent();
+    if (!label) {
+        return;
+    }
+
     if (isPolar) {
         const position = itemModel.get(['label', 'position']);
         el.textConfig.inside = position === 'middle' ? true : null;

Review comment:
       Thanks, maybe we should put  before https://github.com/apache/echarts/blob/6bd27bf3a0454abd68098ece9966ef2943543f19/src/chart/bar/BarView.ts#L989-L996 for which set label rotation.




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