PptxGenJS
PptxGenJS copied to clipboard
Decimals are not formatted as percentages in iPad
Hi all, While trying PPT download in iPad using Safari browser, decimals are not formatted as percentages. The code of iPad is the same as that of PC. PC is working. Here is my option.
let extraoption = {
x: 0,
y: 1,
w: "90%",
h: 4,
valAxisLineShow: true,
showValue: true,
valAxisLabelFormatCode: "0.00%",
showPercent: true,
dataLabelFormatCode: "0.00%",
};
Is this a problem with Safari?
Looking forward to your answer.
I ran the demo scripts on an iPad and all the % formatting worked fine.
If you can supply a full slide code sample of when you experience the issues I'm happy to run it.
I ran the demo scripts on an iPad and all the % formatting worked fine.
If you can supply a full slide code sample of when you experience the issues I'm happy to run it.
This is my test code. I'm sorry I didn't make it clear.It's an error in the chart case.
var pptx = new Ppt(); let bardata = [ { name: "1", labels: ["Name"], values: [0.04], index: 0 }, { name: "2", labels: ["Name"], values: [0.03], index: 1 }, { name: "3", labels: ["Name"], values: [0.02], index: 2 }, { name: "4", labels: ["Name"], values: [0.01], index: 3 }, { name: "5", labels: ["Name"], values: [0.02], index: 4 } ]; let slide1 = pptx.addSlide(); let baroptions = { x: 0.5, y: 1, w: "50%", h: 4, barDir: "col", chartColors: ["72A9DA", "F09050", "97DBE9", "8AE874", "DD5044"], barGrouping: "percentStacked", showTitle: true, title: "Test", showLabel: true, showLegend: true, showPercent: true, showValue: true, legendPos: "b", valAxisLineShow: false, valAxisLabelFormatCode: "0.0%", dataLabelFormatCode: "0.0%", dataLabelPosition: "ctr" }; slide1.addChart(pptx.charts.BAR, bardata, baroptions); pptx.exportPresentation(null).then(content => { var blob = new Blob([content]) FileSaver.saveAs(blob,Test.pptx) });
I'm not sure exactly what you are experiencing. Maybe you could share a screen grab. I'm seeing correctly formatted percentages when generated from iPad in Safari
The only difference is opening on Keynote verses PowerPoint, regardless of device. Keynote drops the decimal place on the vertical axis.
I'm not sure exactly what you are experiencing. Maybe you could share a screen grab. I'm seeing correctly formatted percentages when generated from iPad in Safari
The only difference is opening on Keynote verses PowerPoint, regardless of device. Keynote drops the decimal place on the vertical axis.
Here are screenshots of both versions.
Previously, I found that the files downloaded from the iPad were formatted on the PC. I think it's the IOS problem. I'm not sure.
