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 2020/04/14 06:38:33 UTC

[GitHub] [incubator-echarts] Ovilia commented on a change in pull request #12418: Fix 12109

Ovilia commented on a change in pull request #12418: Fix 12109
URL: https://github.com/apache/incubator-echarts/pull/12418#discussion_r407895981
 
 

 ##########
 File path: src/layout/barPolar.js
 ##########
 @@ -83,6 +83,19 @@ function barLayoutPolar(seriesType, ecModel, api) {
             || !seriesModel.get('roundCap', true);
 
         var valueAxisStart = valueAxis.getExtent()[0];
+        var radiusValueAxisStart;
+        if (valueAxis.dim === 'radius') {
+            radiusValueAxisStart = valueAxis.model.option.min || valueAxis.getExtent()[0];
+            if (valueAxis.model.option.min && valueAxis.model.option.min < 0) {
+                if (!valueAxis.model.option.max
+                    || valueAxis.model.option.max && valueAxis.model.option.max > 0) {
+                    radiusValueAxisStart = valueAxis.getExtent()[0];
+                } else if (valueAxis.model.option.max && valueAxis.model.option.max < 0) {
+                    radiusValueAxisStart = valueAxis.model.option.max;
+                }
+            }
+        }
+
 
 Review comment:
   `valueAxisStart` means the `0` position in the axis extent. You don't need to do all these logics to calculate the `max` because it's already in `valueAxis.scale.getExtent()`.
   
   So my suggestion for this part would be only:
   ```js
   var valueAxisStart = valueAxis.dim === 'radius' 
       ? valueAxis.dataToRadius(0) 
       : valueAxis.dataToAngle(0);
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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