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

Bug fix #589. Workaround for line chart fill color #1930

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

tiagomalheiro
Copy link
Contributor

@tiagomalheiro tiagomalheiro commented Mar 17, 2021

See #589

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

When the fill color property of DataSeries.plotLabel using a DataSeriesValues on a line chart is set, the XLSX file written is corrupted, and MSExcel2016 removes the drawing1.xml if forced open.
This problem was already documented on issue #589 along with a possible solution. So all credits go to @madrussa. I am only submitting the PR.
Used the sample file 33_Chart_create_line to test it and modified it only to include fill color:

// Set the Labels for each data series we want to plot
//     Datatype
//     Cell reference for data
//     Format Code
//     Number of datapoints in series
//     Data values
//     Data Marker
//     Fill Color
$dataSeriesLabels = [
    new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1, [], null, '98B954'), // 2010
    new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1, [], null, 'BE4B48'), // 2011
    new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1, [], null, '4A7EBB'), // 2012
];

@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Jun 26, 2021
@stale stale bot removed the stale label Oct 30, 2021
@tiagomalheiro tiagomalheiro force-pushed the issues/chart-fill branch 4 times, most recently from e8a667b to 7e5c024 Compare October 31, 2021 16:10
@tiagomalheiro tiagomalheiro changed the title Big fix #589. Workaround for line chart fill color Bug fix #589. Workaround for line chart fill color Oct 31, 2021
When the fill color property of `DataSeries.plotLabel` using a
DataSeriesValues on a line chart is set, the XLSX file written
is corrupted, and MSExcel2016 removes the drawing1.xml if forced open.

This problem was already documented on issue PHPOffice#589 along with a possible
solution. So all credits go to @madrussa. I am only submitting the PR.

Fixes PHPOffice#589
Closes PHPOffice#1930
@PowerKiKi PowerKiKi merged commit 0c93bba into PHPOffice:master Nov 23, 2021
@PowerKiKi
Copy link
Member

Thank you for your patience.

@tiagomalheiro tiagomalheiro deleted the issues/chart-fill branch November 23, 2021 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants