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 #1337 Closes #1448
This commit is contained in:
parent
c725128a68
commit
d49567aad0
|
@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
### Fixed
|
||||
|
||||
- ...
|
||||
- Fix Chart samples by updating chart parameter from 0 to DataSeries::EMPTY_AS_GAP [#1448](https://github.com/PHPOffice/PhpSpreadsheet/pull/1448)
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -86,7 +86,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -86,7 +86,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -95,7 +95,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
$xAxisLabel, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -139,7 +139,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
null // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -84,7 +84,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -158,7 +158,7 @@ $chart2 = new Chart(
|
|||
$legend2, // legend
|
||||
$plotArea2, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel2 // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -84,7 +84,7 @@ $chart1 = new Chart(
|
|||
$legend1, // legend
|
||||
$plotArea1, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
null // yAxisLabel - Pie charts don't have a Y-Axis
|
||||
);
|
||||
|
|
|
@ -162,7 +162,7 @@ $chart2 = new Chart(
|
|||
null, // legend
|
||||
$plotArea2, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
null // yAxisLabel - Like Pie charts, Donut charts don't have a Y-Axis
|
||||
);
|
||||
|
|
|
@ -96,7 +96,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
null // yAxisLabel - Radar charts don't have a Y-Axis
|
||||
);
|
||||
|
|
|
@ -80,7 +80,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
null, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -92,7 +92,7 @@ $chart = new Chart(
|
|||
$legend, // legend
|
||||
$plotArea, // plotArea
|
||||
true, // plotVisibleOnly
|
||||
0, // displayBlanksAs
|
||||
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
|
||||
$xAxisLabel, // xAxisLabel
|
||||
$yAxisLabel // yAxisLabel
|
||||
);
|
||||
|
|
|
@ -156,7 +156,7 @@ class Chart
|
|||
* @param null|GridLines $majorGridlines
|
||||
* @param null|GridLines $minorGridlines
|
||||
*/
|
||||
public function __construct($name, Title $title = null, Legend $legend = null, PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = 'gap', Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null)
|
||||
public function __construct($name, Title $title = null, Legend $legend = null, PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = DataSeries::EMPTY_AS_GAP, Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->title = $title;
|
||||
|
|
|
@ -40,6 +40,10 @@ class DataSeries
|
|||
const STYLE_MARKER = 'marker';
|
||||
const STYLE_FILLED = 'filled';
|
||||
|
||||
const EMPTY_AS_GAP = 'gap';
|
||||
const EMPTY_AS_ZERO = 'zero';
|
||||
const EMPTY_AS_SPAN = 'span';
|
||||
|
||||
/**
|
||||
* Series Plot Type.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue