Skip to content

Commit c1f7611

Browse files
cwolcottPowerKiKi
authored andcommitted
File containing a chart can be opened by Excel 2003/2013/2019
All chart examples passed the displayBlanksAs parameter as 0 instead of 'gap'. I added a constants EMPTY_AS_GAP, EMPTY_AS_ZERO and EMPTY_AS_SPAN to the DataSeries and then change all chart samples to use this new constant. Fixes PHPOffice#1337 Closes PHPOffice#1448
1 parent 5cd3410 commit c1f7611

15 files changed

+18
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1414

1515
### Fixed
1616

17-
- ...
17+
- Fix Chart samples by updating chart parameter from 0 to DataSeries::EMPTY_AS_GAP [#1448](https://github.com/PHPOffice/PhpSpreadsheet/pull/1448)
1818

1919
### Changed
2020

samples/Chart/33_Chart_create_area.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
$legend, // legend
8484
$plotArea, // plotArea
8585
true, // plotVisibleOnly
86-
0, // displayBlanksAs
86+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
8787
null, // xAxisLabel
8888
$yAxisLabel // yAxisLabel
8989
);

samples/Chart/33_Chart_create_bar_stacked.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
$legend, // legend
8787
$plotArea, // plotArea
8888
true, // plotVisibleOnly
89-
0, // displayBlanksAs
89+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
9090
null, // xAxisLabel
9191
$yAxisLabel // yAxisLabel
9292
);

samples/Chart/33_Chart_create_column.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
$legend, // legend
8787
$plotArea, // plotArea
8888
true, // plotVisibleOnly
89-
0, // displayBlanksAs
89+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
9090
null, // xAxisLabel
9191
$yAxisLabel // yAxisLabel
9292
);

samples/Chart/33_Chart_create_column_2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
$legend, // legend
9696
$plotArea, // plotArea
9797
true, // plotVisibleOnly
98-
0, // displayBlanksAs
98+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
9999
$xAxisLabel, // xAxisLabel
100100
$yAxisLabel // yAxisLabel
101101
);

samples/Chart/33_Chart_create_composite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
$legend, // legend
140140
$plotArea, // plotArea
141141
true, // plotVisibleOnly
142-
0, // displayBlanksAs
142+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
143143
null, // xAxisLabel
144144
null // yAxisLabel
145145
);

samples/Chart/33_Chart_create_line.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
$legend, // legend
8585
$plotArea, // plotArea
8686
true, // plotVisibleOnly
87-
0, // displayBlanksAs
87+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
8888
null, // xAxisLabel
8989
$yAxisLabel // yAxisLabel
9090
);

samples/Chart/33_Chart_create_multiple_charts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
$legend2, // legend
159159
$plotArea2, // plotArea
160160
true, // plotVisibleOnly
161-
0, // displayBlanksAs
161+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
162162
null, // xAxisLabel
163163
$yAxisLabel2 // yAxisLabel
164164
);

samples/Chart/33_Chart_create_pie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
$legend1, // legend
8585
$plotArea1, // plotArea
8686
true, // plotVisibleOnly
87-
0, // displayBlanksAs
87+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
8888
null, // xAxisLabel
8989
null // yAxisLabel - Pie charts don't have a Y-Axis
9090
);

samples/Chart/33_Chart_create_pie_custom_colors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
null, // legend
163163
$plotArea2, // plotArea
164164
true, // plotVisibleOnly
165-
0, // displayBlanksAs
165+
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
166166
null, // xAxisLabel
167167
null // yAxisLabel - Like Pie charts, Donut charts don't have a Y-Axis
168168
);

0 commit comments

Comments
 (0)