singerla / pptx-automizer

A template based pptx generator for Node.js
MIT License
68 stars 12 forks source link

question: Slide with two charts #114

Closed jrking4 closed 2 months ago

jrking4 commented 3 months ago

Does anyone have an example where lets say i have a Template: Slide One: contains a bar chart Slide Two: contains a pie chart Slide Three: contains a slide with two "placeholders" for example 2 shapes or images

When creating a new presentation, can i take the bar chart from slide one. and the pie chart from slide two and "replace" the shape/image from slide three with this content? basically take the X, Y, and width/height of the shapes from slide 3?

MP70 commented 3 months ago

Assuming your placeholder is not a chart itself (you mentioned wanting a image or shape), you would need to: 1) Get the placeholder position 2) Delete the placeholder 3) Copy the chart in using the $placeholderPosition.

I'm not sure how good your results will be if you have a widely varying amount/shape of chart data to set.

singerla commented 3 months ago

My latest commit gives an example on how to copy shape coordinates. Please do also take a look at the readme to find more information about this.

jrking4 commented 3 months ago

thanks for the example that is super helpful!