-
Notifications
You must be signed in to change notification settings - Fork 633
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
Values of 0 (zero) in series are missing in line chart #240
Comments
gitbrent
changed the title
0 values in series missing in line chart
Values of 0 (zero) in series are missing in line chart
Nov 16, 2017
Thanks for opening this issue @andrei-cs, and thanks to @hilnius for the contribution. The Issue is now fixed in the current codebase: var pptx = new PptxGenJS();
var slide = pptx.addNewSlide();
var chartData = [{
"name": "Chart",
"labels": [ "16-Oct-17", "17-Oct-17", "18-Oct-17", "19-Oct-17", "20-Oct-17", "21-Oct-17", "22-Oct-17", "23-Oct-17", "24-Oct-17", "25-Oct-17", "26-Oct-17", "27-Oct-17", "28-Oct-17", "29-Oct-17", "30-Oct-17", "31-Oct-17", "01-Nov-17", "02-Nov-17", "03-Nov-17", "04-Nov-17", "05-Nov-17", "06-Nov-17", "07-Nov-17", "08-Nov-17", "09-Nov-17", "10-Nov-17", "11-Nov-17", "12-Nov-17", "13-Nov-17", "14-Nov-17", "15-Nov-17" ],
"values": [ 0, 0, 149, 141, 0, 0, 0, 0, 0, 0, 139, 1177, 477, 0, 0, 2578, 0, 0, 349, 0, 0, 0, 2195, 1057, 807, 0, 0, 0, 148, 241, 0 ]
}];
slide.addChart( pptx.charts.LINE, chartData);
pptx.save(); |
Hi everyone, |
ericrockey
pushed a commit
to WeTransfer/PptxGenJS
that referenced
this issue
Mar 24, 2020
ericrockey
pushed a commit
to WeTransfer/PptxGenJS
that referenced
this issue
Mar 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a series having 0's as values the points don't show up in the graph when viewing the PPT in Powerpoint.
If instead of providing 0's as numerical values I provide them as strings, the chart displays properly.
Code snippets from the provided JSFiddle.
Ex: Not working Values array:
var pptx = new PptxGenJS(); var slide = pptx.addNewSlide(); var opts = { x:1.0, y:1.0, font_size:42, color:'00FF00' }; slide.addText('Hello World!', opts); var chartData = [ { "name": "Chart", "labels": [ "16-Oct-17", "17-Oct-17", "18-Oct-17", "19-Oct-17", "20-Oct-17", "21-Oct-17", "22-Oct-17", "23-Oct-17", "24-Oct-17", "25-Oct-17", "26-Oct-17", "27-Oct-17", "28-Oct-17", "29-Oct-17", "30-Oct-17", "31-Oct-17", "01-Nov-17", "02-Nov-17", "03-Nov-17", "04-Nov-17", "05-Nov-17", "06-Nov-17", "07-Nov-17", "08-Nov-17", "09-Nov-17", "10-Nov-17", "11-Nov-17", "12-Nov-17", "13-Nov-17", "14-Nov-17", "15-Nov-17" ], "values": [ 0, 0, 149, 141, 0, 0, 0, 0, 0, 0, 139, 1177, 477, 0, 0, 2578, 0, 0, 349, 0, 0, 0, 2195, 1057, 807, 0, 0, 0, 148, 241, 0 ] } ] slide.addChart( pptx.charts.LINE, chartData) pptx.save();
Ex: Working Values Array
var pptx = new PptxGenJS(); var slide = pptx.addNewSlide(); var opts = { x:1.0, y:1.0, font_size:42, color:'00FF00' }; slide.addText('Hello World!', opts); var chartData = [ { "name": "Chart", "labels": [ "16-Oct-17", "17-Oct-17", "18-Oct-17", "19-Oct-17", "20-Oct-17", "21-Oct-17", "22-Oct-17", "23-Oct-17", "24-Oct-17", "25-Oct-17", "26-Oct-17", "27-Oct-17", "28-Oct-17", "29-Oct-17", "30-Oct-17", "31-Oct-17", "01-Nov-17", "02-Nov-17", "03-Nov-17", "04-Nov-17", "05-Nov-17", "06-Nov-17", "07-Nov-17", "08-Nov-17", "09-Nov-17", "10-Nov-17", "11-Nov-17", "12-Nov-17", "13-Nov-17", "14-Nov-17", "15-Nov-17" ], "values": [ '0', '0', 149, 141, '0', '0', '0', '0', '0', '0', 139, 1177, 477, '0', '0', 2578, '0', '0', 349, '0', '0', '0', 2195, 1057, 807, '0', '0', '0', 148, 241, '0' ] } ] slide.addChart( pptx.charts.LINE, chartData) pptx.save();
The text was updated successfully, but these errors were encountered: