We are modernizing our Excel VBA add-in to Office.js. One of the functions of our add-in is to format charts into company branding. Since we cannot manipulate default Microsoft chart elements, we use text boxes for the chart title, subtitle, axis labels and footer elements (e.g., notes, source). We group these text boxes within the chart itself. In Office.js, we have been to able to identify text boxes but we cannot select them or group them within a chart. Can this functionality be added?
1 Comment
- AdrianWu
Microsoft
Hi, thank you very much for the feature suggestion!
The grouping capability should be already doable today.
Please check shapecollection.addGroup()
For exact implementation sample, please see below:const chartShape = sheet.shapes.getItem(chart.id); const group = sheet.shapes.addGroup([textbox, chartShape]);
However, if you expect to insert shapes and text boxes directly into the chart rather than keeping them outside of it, this capability is not feasible today. This issue has been tracked in this feature request -
Add Support for Shapes in Charts to Excel OnlinePlease help vote in that thread if it aligns with what you're looking for. Higher engagement here will help us better prioritize this request among the current asks. Thank you so much!