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/02/09 04:49:16 UTC

[GitHub] [echarts] RavalikaP opened a new issue #16480: Need x,y,Width,Height of the chart elements

RavalikaP opened a new issue #16480:
URL: https://github.com/apache/echarts/issues/16480


   ### What problem does this feature solve?
   
   Need X, Y position along with Height and Weight of the chart elements like xAxis, yAxis, Grid, Legends.
   If we get this values we will append some graphic elements to it and apply some styling to it.
   
   
   ### What does the proposed API look like?
   
   ![image](https://user-images.githubusercontent.com/15928301/153123823-bc4600ed-5954-4cca-ba29-bbc9848201c9.png)
   ![image](https://user-images.githubusercontent.com/15928301/153123886-634733ec-ad05-4add-a394-3e4dbfc28fe9.png)
   


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


[GitHub] [echarts] plainheart commented on issue #16480: Need x,y,Width,Height of the chart elements

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #16480:
URL: https://github.com/apache/echarts/issues/16480#issuecomment-1034571735


   @RavalikaP It's similar to the above.
   
   ```js
   const legendModel = chart.getModel().getComponent('legend');
   const legendView = chart.getViewOfComponentModel(legendModel);
   const legendRect = legendView.group.getBoundingRect();
   const [x, y] = legendView.group.transformCoordToGlobal(legendRect.x, legendRect.y);
   const { width, height } = legendRect;
   console.log(x, y, width, 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: 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


[GitHub] [echarts] Ovilia commented on issue #16480: Need x,y,Width,Height of the chart elements

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #16480:
URL: https://github.com/apache/echarts/issues/16480#issuecomment-1034420390


   There are no such APIs but you can get this information `option.grid` and ` option.legend` from your input option.


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


[GitHub] [echarts] RavalikaP commented on issue #16480: Need x,y,Width,Height of the chart elements

Posted by GitBox <gi...@apache.org>.
RavalikaP commented on issue #16480:
URL: https://github.com/apache/echarts/issues/16480#issuecomment-1034533891


   @plainheart , Thank you for the reply. can u please suggest me how to get the legends?
   
   


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


[GitHub] [echarts] RavalikaP commented on issue #16480: Need x,y,Width,Height of the chart elements

Posted by GitBox <gi...@apache.org>.
RavalikaP commented on issue #16480:
URL: https://github.com/apache/echarts/issues/16480#issuecomment-1034490391


   @Ovilia but on option.legend and option.grid we are not getting the updated values. If it is updated then it will be easy to get 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.

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


[GitHub] [echarts] plainheart commented on issue #16480: Need x,y,Width,Height of the chart elements

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #16480:
URL: https://github.com/apache/echarts/issues/16480#issuecomment-1034501496


   You may get such information via some internal APIs. Just FYI.
   
   **Grid**
   
   ```js
   // if there are multiple grids, use `getComponent('grid', gridIndex)`
   const gridRect = chart.getModel().getComponent('grid').coordinateSystem.getRect();
   ```
   
   **Axis**
   
   ```js
   // if there are multiple axes, use `getComponent('xAxis', axisIndex)`
   const xAxisModel = chart.getModel().getComponent('xAxis');
   const xAxisView = chart.getViewOfComponentModel(xAxisModel);
   const xAxisRect = xAxisView.group.getBoundingRect();
   ```


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