Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix category display in Google Slides #1273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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