Skip to content

Conversation

christiankiely
Copy link

This fixes an issue when importing generated PPTX files with charts into Google Slides.

It appears Google Slides' importer does not like the use of multiLvlStrRef, and displays categories as simple numbers.


For example, using this code to generate a pptx file:

  const pres = new pptxgen();
  const slide = pres.addSlide();
  slide.addChart(
    pres.ChartType.bar,
    [
      {
        name: "Categories",
        labels: ["Category A", "Category B", "Category C"],
        values: [500, 200, 350],
      },
    ],
    {
      x: 1,
      y: 1,
      w: 5,
      h: 3,
    }
  );

Appears like this in PowerPoint vs Google Slides:

Microsoft PowerPoint Google Slides
CleanShot 2023-07-10 at 16 20 53@2x CleanShot 2023-07-10 at 16 22 33@2x

Using strRef instead of multiLvlStrRef when there is only one set of labels appears to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant