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 2022/11/30 08:48:52 UTC

[GitHub] [echarts] Ovilia opened a new pull request, #17995: fix(polar): support borderRadius for polar bars #17980

Ovilia opened a new pull request, #17995:
URL: https://github.com/apache/echarts/pull/17995

   <!-- 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?
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   support borderRadius for polar bars
   
   ### Fixed issues
   
   #17980
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   `itemStyle.borderRadius` is not supported for polar bars.
   
   ### After: How does it behave after the fixing?
   
   `itemStyle.borderRadius` is supported like Sunburst or Pie charts.
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] This PR doesn't relate to document changes
   - [x] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### 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] echarts-bot[bot] commented on pull request #17995: fix(polar): support borderRadius for polar bars #17980

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #17995:
URL: https://github.com/apache/echarts/pull/17995#issuecomment-1455711787

   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 pull request #17995: fix(polar): support borderRadius for polar bars #17980

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on PR #17995:
URL: https://github.com/apache/echarts/pull/17995#issuecomment-1455657287

   Merging latest master branch into this branch can solve the lint action error.


-- 
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 diff in pull request #17995: fix(polar): support borderRadius for polar bars #17980

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on code in PR #17995:
URL: https://github.com/apache/echarts/pull/17995#discussion_r1125836950


##########
src/chart/bar/BarView.ts:
##########
@@ -981,7 +985,20 @@ function updateStyle(
     const style = data.getItemVisual(dataIndex, 'style');
 
     if (!isPolar) {
-        (el as Rect).setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0);
+        const borderRadius = itemModel
+            .get(['itemStyle', 'borderRadius']) as number | number[] || 0;
+        (el as Rect).setShape('r', borderRadius);
+    }
+    else if (!seriesModel.get('roundCap')) {
+        const sector = el as Sector;
+        const sectorShape = (el as Sector).shape;
+        const cornerRadius = getSectorCornerRadius(
+            itemModel.getModel('itemStyle'),
+            sectorShape,
+            true
+        );
+        extend(sectorShape, cornerRadius);
+        sector.setShape(sectorShape);

Review Comment:
   Use `(el as Sector).setShape(sectorShape)` instead.



##########
src/chart/bar/BarView.ts:
##########
@@ -981,7 +985,20 @@ function updateStyle(
     const style = data.getItemVisual(dataIndex, 'style');
 
     if (!isPolar) {
-        (el as Rect).setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0);
+        const borderRadius = itemModel
+            .get(['itemStyle', 'borderRadius']) as number | number[] || 0;
+        (el as Rect).setShape('r', borderRadius);
+    }
+    else if (!seriesModel.get('roundCap')) {
+        const sector = el as Sector;

Review Comment:
   Unnecessary declaration for the variable `sector`. This line can be removed.



-- 
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 merged pull request #17995: fix(polar): support borderRadius for polar bars #17980

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart merged PR #17995:
URL: https://github.com/apache/echarts/pull/17995


-- 
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 #17995: fix(polar): support borderRadius for polar bars #17980

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

   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.
   
   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


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