gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
3k stars 645 forks source link

STACKED BAR CHART CREATING BROKEN PPT #1357

Open nishchay4 opened 2 weeks ago

nishchay4 commented 2 weeks ago

We appreciate your feedback - to help the team understand your needs please complete the following template to ensure we have the details to help.

Submission Guidelines

Issue Category

Product Versions

Desired Behavior

Observed Behavior

-- On passing data array with multiple objects to addchart function it works fine and on passing single object to data array, broken ppt is generated and even after repairing it chart slide comes empty.

Steps to Reproduce

Add following data to addChart function(in values array tried replacing undefined with 0, still got the same result:broken ppt, on passing 21 such objects in data array, functional ppt is generated without breaking ):

const stackedbarData = [{ "name": "CBDCA", "labels": ["201401", "201402", "201403", "201404", "201405", "201406", "201407", "201408", "201409", "201410", "201411", "201412", "201501", "201502", "201503", "201504", "201505", "201506", "201507", "201508", "201509", "201510", "201511", "201512", "201601", "201602", "201603", "201604", "201605", "201606", "201607", "201608", "201609", "201610", "201611", "201612", "201701", "201702", "201703", "201704", "201705", "201706", "201707", "201708", "201709", "201710", "201711", "201712", "201801", "201802", "201803", "201804", "201805", "201806", "201807", "201808", "201809", "201810", "201811", "201812", "201901", "201902", "201903", "201904", "201905", "201906", "201907", "201908", "201909", "201910", "201911", "201912", "202001", "202002", "202003", "202004", "202005", "202006", "202007", "202008", "202009", "202010", "202011", "202012", "202101", "202102", "202103", "202104", "202105", "202106", "202107", "202108", "202109", "202110", "202111", "202112"], "values": [undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 100, 100, 100, 100, 100, 0, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 100, 100, 100, 100, 100, 0, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 100, 0, undefined, 100, 100, 100, 0, 100, 100, 0, 100, undefined, 100, 100, 100, 100, 0, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100] }];

slide.addChart('bar',stackedbarData, {barDir: "col" barGrouping: "percentStacked" catAxisLabelFontFace: "Arial" catAxisLabelFontSize: 6 catAxisOrientation: "minMax" catAxisTitle: " " catAxissubNodelabelColor: "000000" chartColors: (2)['#935AD6', '#6BC2ED'] h: 3.5 legendFontSize: 8 legendPos: "t" showCatAxisTitle: true showLegend: true showPercent: true showValAxisTitle: true valAxisLabelFormatCode: "#%" valAxisMajorUnit: 0.2 valAxisTitle: "Market Share (%)" w: 8 x: 1 y: 1});

This generates a broken PPT.

pselle commented 1 day ago

I suspect this is a duplicate of #1233