plainheart commented on issue #19755: URL: https://github.com/apache/echarts/issues/19755#issuecomment-2017686354
暂无公开 API 获取,可参考如下使用私有 API 从 BoundingRect 中得到高度。[Demo](https://echarts.apache.org/examples/zh/editor.html?renderer=svg&code=PYBwLglsB2AEC8sDeAoWsA2BTA5l6AJgFzIC-ANGrAB4CC1EAziauumAJ4hYkDkAxgEMwuYACcOvSm1gFhgkgG1eAWRhTYvACoBXLBt4B1LAQNaAFjoMAxMRAMBlYY53ReAXSoUqHekxZU7Fw8mgBughh6vF7SsIxYdljMsIqByGno0IIAtiG8AKLZghAYUhmwnNx8GBDQ-rEycmAKKQCMAEwADOSwrQDM7T2tna1DfQAsPQCc3bDtfbPtw54ypFSepADcKCjZHADC5oJiYAB0MAAUvGL4BAkmGhcAlAgAfOno_DCMYJi4twAJLAQHDmX6IPBgAAy_0I-2A2RAMHwYCBILBz22n2-wGwpwwwBwF2weEIaNBYCe21IVJ2ADNXPxIDBYJCYaSCPDEcjoKjgRTnh9YF9oD9hQikXVeWo7hgELA9odjmdITKsBhnqdIVzJSiriTbrxadjRb8vtypWAAGoQLAAd3liqOJy1WGttrtAHk6TqeWA1RrzbrpcBZcbxabYDcmfKg36bfatWJgDoQK6wAAhFOEWo4ABKWCZmKoNzAOjEcGjZ3M_LB1KAA) ```js function getLegendComponentHeight() { const componentModel = myChart.getModel().getComponent('legend'); const componentView = myChart.getViewOfComponentModel(componentModel); const rect = componentView.group.getBoundingRect(); return rect.height; } ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
