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

Line chart with one series displays broken in Powerpoint with version 1.9.0 #225

Closed
andrei-cs opened this issue Nov 3, 2017 · 3 comments
Assignees
Milestone

Comments

@andrei-cs
Copy link

andrei-cs commented Nov 3, 2017

Adding a series like in the example:

var MONS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var dataChartLine = [
{
name: 'Proj Sales', labels: MONS,
values: [1000, 2600, 3456, 4567, 5010, 6009, 7006, 8855, 9102, 10789, 11123, 12121]
}
];
slide.addChart(
pptx.charts.LINE, dataChartLine,
{ x:4.3, y:4.0, w:4.0, h:3.2, chartColors:['0088CC','99FFCC'], chartColorsOpacity:25,
dataBorder: {pt:2, color:'FFFFFF'}, fill:'D1E1F1' }
);

creates a chart that displays a legend item for each label in the MONS set.

image

When trying it with v1.7.0 everything looks fine. Graphs with two series display correctly.

@gitbrent
Copy link
Owner

gitbrent commented Nov 7, 2017

Hi @andrei-cs ,

Thanks for opening this issue!

The defect was triggered when using a single data series along with the chartColors option.

var MONS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_WIDE');
var slide = pptx.addNewSlide();

var dataChartLine = [{ name: 'Proj Sales', labels: MONS, values: [1000, 2600, 3456, 4567, 5010, 6009, 7006] }];
var dataChartLine2 = [
	{ name: 'Proj Sales 1', labels: MONS, values: [2000, 2600, 3456, 4567, 5010, 6009, 7006] },
	{ name: 'Proj Sales 2', labels: MONS, values: [2100, 2600, 3456, 4567, 5010, 6009, 7006] }
];

slide.addChart( pptx.charts.LINE, dataChartLine, { x:.5, y:1, w:6, h:3, chartColors:['0088CC'],showLegend: true });
slide.addChart( pptx.charts.LINE, dataChartLine, { x:.5, y:4, w:6, h:3, showLegend: true });
slide.addChart( pptx.charts.LINE, dataChartLine2, { x:6.5, y:1, w:6, h:3, chartColors:['0088CC'],showLegend: true });

pptx.save('PptxGenJS-Sandbox_'+getTimestamp());

Before:
screen shot 2017-11-06 at 21 00 54

After:
screen shot 2017-11-06 at 21 01 25

@gitbrent gitbrent added this to the 1.10.0 milestone Nov 7, 2017
gitbrent pushed a commit that referenced this issue Nov 7, 2017
gitbrent pushed a commit that referenced this issue Nov 7, 2017
@gitbrent gitbrent closed this as completed Nov 7, 2017
@andrei-cs
Copy link
Author

Thanks for the quick response. I guess it will go out with 1.10.0 release.

@gitbrent
Copy link
Owner

gitbrent commented Nov 8, 2017

Yes, it's tagged for v1.10.0 - it'll be released this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants