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/06/11 05:13:08 UTC

[GitHub] [incubator-echarts] yanheSu commented on a change in pull request #12793: fix(pictorialBar): Fixed a problem with rendering incorrectly when data is 0 and `borderWidth` is set to a non-0 value

yanheSu commented on a change in pull request #12793:
URL: https://github.com/apache/incubator-echarts/pull/12793#discussion_r438546327



##########
File path: src/chart/bar/PictorialBarView.js
##########
@@ -227,7 +227,9 @@ function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {
         output.repeatCutLength = layout[valueDim.wh];
     }
 
-    output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;
+    // if 'pxSign' means sign of pixel,  it can't be zero, or symboScale will be zero
+    // and when borderwidth be setted, the actual linewidth will be NaN
+    output.pxSign = boundingLength > 0 ? 1 : -1;

Review comment:
       I originally planned to modify it like this, but if it is modified like this, the graph representing this data will disappear. When symbolSize is specified, should such a display be made?
   And as a pixel sign, why can the sign be 0?
   Based on the above doubts, I made the current modification. Under this modification, when the symbolSize is specified, even if the data is 0, the data will be displayed at the corresponding data position.
   However, I also think that a conditional selection statement should also be added here to prevent the situation where the dividend is 0.
   
   Sorry, I just used the wrong account, so delete the previous comment and re-send it.🌚




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



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