I am developing an add-in using the PowerPoint API and have inserted a chart via the ribbon tab. I successfully located the chart through Office.js with the code provided below.
async function run() {
await PowerPoint.run(async (context) => {
debugger;
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
shapes.load("type");
await context.sync();
// Change the shape transparency to be halfway transparent.
shapes.items.forEach((shape) => {
if (shape.type === PowerPoint.ShapeType.chart) {
});
}
However, I am unable to read the chart data. Is there a property or method available that allows me to read and update the chart data? If it is there then please guide me through it or else is there any other alternative way to read the data then also suggest.
My Environment
Platform : PC desktop
Host: Word
Office version number: Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2501 Build 16.0.18429.20132) 64-bit
Operating System: Windows 11
I am developing an add-in using the PowerPoint API and have inserted a chart via the ribbon tab. I successfully located the chart through Office.js with the code provided below.
async function run() {
await PowerPoint.run(async (context) => {
debugger;
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
shapes.load("type");
await context.sync();
// Change the shape transparency to be halfway transparent.
shapes.items.forEach((shape) => {
if (shape.type === PowerPoint.ShapeType.chart) {
});
}
However, I am unable to read the chart data. Is there a property or method available that allows me to read and update the chart data? If it is there then please guide me through it or else is there any other alternative way to read the data then also suggest.
My Environment
Platform : PC desktop
Host: Word
Office version number: Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2501 Build 16.0.18429.20132) 64-bit
Operating System: Windows 11