Skip to content

[bug][error] Chart with lines and bars produces repair file dialog in Powerpoint #1013

@kornarakis

Description

@kornarakis

Type: Bug
Library Version: 3.8.0
Powerpoint Version: 365
Framework used: VueJS

Observed Behavior

The following chart was working perfectly but now shows repair dialog in Powerpoint and some times Powerpoint is unable to repair the file.

Steps to Reproduce

Demo code

const pptx = new Pptxgen();

pptx.author = "The author name";
pptx.company = "The company name";
pptx.revision = "1";
pptx.subject = "A subject here";
pptx.title = "A title here";
pptx.defineLayout({
  name: "Custom",
  width: 11.694,
  height: 8.264,
});
pptx.layout = "Custom";

let slide1= pptx.addSlide();
slide1.addChart(
  [
    {
      type: "bar",
      data: [
        {
          name: "one",
          labels: [
            "label 1",
            "label 2",
            "label 3",
            "label 4",
            "label 5",
            "label 6",
            "label 7",
            "label 8",
            "label 9",
            "label 10",
            "label 11",
          ],
          values: [54, 69, 223, 401, 501, 731, 901, 639, 424, 685, 447],
        },
      ],
      options: {
        chartColors: ["FED9FF"],
      },
    },
    {
      type: "line",
      data: [
        {
          name: "two",
          labels: [
            "label 1",
            "label 2",
            "label 3",
            "label 4",
            "label 5",
            "label 6",
            "label 7",
            "label 8",
            "label 9",
            "label 10",
            "label 11",
          ],
          values: [13, 28, 67, 94, 107, 127, 143, 100, 66, 59, 22],
        },
      ],
      options: {
        lineSize: 0,
        lineDataSymbol: "circle",
        lineDataSymbolSize: 10,
        lineDataSymbolLineSize: 2,
        lineDataSymbolLineColor: "0096FF",
        chartColors: ["FFFFFF"],
        secondaryValAxis: true,
        secondaryCatAxis: true,
      },
    },
    {
      type: "line",
      data: [
        {
          name: "three",
          labels: [
            "label 1",
            "label 2",
            "label 3",
            "label 4",
            "label 5",
            "label 6",
            "label 7",
            "label 8",
            "label 9",
            "label 10",
            "label 11",
          ],
          values: [80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80],
        },
      ],
      options: {
        lineSize: 2,
        lineDataSymbol: "none",
        chartColors: ["D6D6D6"],
        secondaryValAxis: true,
        secondaryCatAxis: true,
      },
    },
    {
      type: "line",
      data: [
        {
          name: "four",
          labels: [
            "label 1",
            "label 2",
            "label 3",
            "label 4",
            "label 5",
            "label 6",
            "label 7",
            "label 8",
            "label 9",
            "label 10",
            "label 11",
          ],
          values: [120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120],
        },
      ],
      options: {
        lineSize: 2,
        lineDataSymbol: "none",
        chartColors: ["53585F"],
        secondaryValAxis: true,
        secondaryCatAxis: true,
      },
    },
  ],

  {
    x: 1.15,
    y: 2.24,
    w: 9.39,
    h: 4.49,
    legendPos: "b",
    barGapWidthPct: 50,
    showLegend: true,
    showTitle: false,
    catAxisLabelFontSize: 10,
    valAxes: [
      {
        showValAxisTitle: true,
        valAxisTitle: "something",
      },
      {
        showValAxisTitle: true,
        valAxisTitle: "something here",
        valGridLine: {
          style: "none",
        },
      },
    ],
    catAxes: [
      {},
      {
        catAxisHidden: true,
      },
    ],
  }
);

pptx.writeFile({ fileName: "demo.pptx" }).then(() => {});

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions