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/08/29 10:16:05 UTC

[GitHub] [echarts] Ovilia commented on a diff in pull request #16572: fix(bar): barMinHeight invalid. close #16565

Ovilia commented on code in PR #16572:
URL: https://github.com/apache/echarts/pull/16572#discussion_r957142995


##########
src/layout/barGrid.ts:
##########
@@ -533,14 +538,18 @@ export function createProgressiveLayout(seriesType: string): StageHandler {
                                 const startCoord = cartesian.dataToPoint([startValue, baseValue]);
                                 baseCoord = startCoord[0];
                             }
-                            x = baseCoord;
+                            x = lastStackCoords[baseValue] || baseCoord;

Review Comment:
   `lastStackCoords[baseValue]` could be 0 (e.g., `grid.left` is 0) so using `||` is not correct. Use `retrieve2` instead.



##########
src/layout/barGrid.ts:
##########
@@ -533,14 +538,18 @@ export function createProgressiveLayout(seriesType: string): StageHandler {
                                 const startCoord = cartesian.dataToPoint([startValue, baseValue]);
                                 baseCoord = startCoord[0];
                             }
-                            x = baseCoord;
+                            x = lastStackCoords[baseValue] || baseCoord;
                             y = coord[1] + columnOffset;
                             width = coord[0] - baseCoord;
                             height = columnWidth;
 
                             if (Math.abs(width) < barMinHeight) {
                                 width = (width < 0 ? -1 : 1) * barMinHeight;
                             }
+                            if (!lastStackCoords[baseValue]) {

Review Comment:
   It should be `lastStackCoords[baseValue] != null`.



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