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/04/18 01:59:06 UTC

[GitHub] [echarts] jiawulin001 commented on a diff in pull request #16880: fix: xAxis label overflow fixed when containLabel=true

jiawulin001 commented on code in PR #16880:
URL: https://github.com/apache/echarts/pull/16880#discussion_r851836766


##########
src/coord/cartesian/Grid.ts:
##########
@@ -202,10 +200,32 @@ class Grid implements CoordinateSystemMaster {
                     }
                 }
             });
-
+            //Adjust grid.width to keep xAxis labels in dom
+            const [xAxis, yAxis] = axesList[0].isHorizontal() ? axesList : axesList.slice().reverse();

Review Comment:
   Please correct me if I misunderstand you. The function `labelUnionRect` actually returns the largest bounding box of all labels of an axis, not the union bounding box. So I am not sure how to get the union rect of xAxis with this function. Also it would be hard to get the real size of displayed bounding box of labels because echarts seems to automatically clip labels according to axis length. That's why we just need to make sure the first/last label does not exceed the dom.



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