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

Chart Samples Fix #1448

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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)
- Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267)
- Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296)
- Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282)
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_area.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_bar_stacked.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_column_2.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
$xAxisLabel, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_composite.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
null // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_line.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_multiple_charts.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
$legend2, // legend
$plotArea2, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel2 // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_pie.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
$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
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_pie_custom_colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
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
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_radar.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
$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
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_scatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
null, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion samples/Chart/33_Chart_create_stock.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
$legend, // legend
$plotArea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
DataSeries::EMPTY_AS_GAP, // displayBlanksAs
$xAxisLabel, // xAxisLabel
$yAxisLabel // yAxisLabel
);
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Chart/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/PhpSpreadsheet/Chart/DataSeries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down