From 8ed9c514356820c0e66a89e2dca84f93c51bf98c Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 16 Jul 2015 09:14:21 +0100 Subject: [PATCH 1/2] When creating a chart 'displayBlanksAs' does not have any affect. --- Classes/PHPExcel/Writer/Excel2007/Chart.php | 2 +- Examples/33chartcreate-area.php | 2 +- Examples/33chartcreate-bar-stacked.php | 2 +- Examples/33chartcreate-bar.php | 2 +- Examples/33chartcreate-column-2.php | 2 +- Examples/33chartcreate-column.php | 2 +- Examples/33chartcreate-composite.php | 2 +- Examples/33chartcreate-line.php | 2 +- Examples/33chartcreate-multiple-charts.php | 4 ++-- Examples/33chartcreate-pie.php | 4 ++-- Examples/33chartcreate-radar.php | 2 +- Examples/33chartcreate-scatter.php | 2 +- Examples/33chartcreate-stock.php | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index ebe0018f2..9e2073ea8 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Chart.php +++ b/Classes/PHPExcel/Writer/Excel2007/Chart.php @@ -85,7 +85,7 @@ public function writeChart(PHPExcel_Chart $pChart = null) $objWriter->endElement(); $objWriter->startElement('c:dispBlanksAs'); - $objWriter->writeAttribute('val', "gap"); + $objWriter->writeAttribute('val', $pChart->getDisplayBlanksAs()); $objWriter->endElement(); $objWriter->startElement('c:showDLblsOverMax'); diff --git a/Examples/33chartcreate-area.php b/Examples/33chartcreate-area.php index fac8ce93f..babd49433 100644 --- a/Examples/33chartcreate-area.php +++ b/Examples/33chartcreate-area.php @@ -113,7 +113,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-bar-stacked.php b/Examples/33chartcreate-bar-stacked.php index af9493f7a..d4710660d 100644 --- a/Examples/33chartcreate-bar-stacked.php +++ b/Examples/33chartcreate-bar-stacked.php @@ -116,7 +116,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-bar.php b/Examples/33chartcreate-bar.php index 653675d69..5e9e9e785 100644 --- a/Examples/33chartcreate-bar.php +++ b/Examples/33chartcreate-bar.php @@ -116,7 +116,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-column-2.php b/Examples/33chartcreate-column-2.php index 0ade332c9..71c055abd 100644 --- a/Examples/33chartcreate-column-2.php +++ b/Examples/33chartcreate-column-2.php @@ -125,7 +125,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero $xAxisLabel, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-column.php b/Examples/33chartcreate-column.php index 67f417847..ffb2b3c56 100644 --- a/Examples/33chartcreate-column.php +++ b/Examples/33chartcreate-column.php @@ -116,7 +116,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-composite.php b/Examples/33chartcreate-composite.php index be7ad94a7..2cc76815c 100644 --- a/Examples/33chartcreate-composite.php +++ b/Examples/33chartcreate-composite.php @@ -174,7 +174,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel NULL // yAxisLabel ); diff --git a/Examples/33chartcreate-line.php b/Examples/33chartcreate-line.php index 90c2e60c0..cf3d05eef 100644 --- a/Examples/33chartcreate-line.php +++ b/Examples/33chartcreate-line.php @@ -113,7 +113,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-multiple-charts.php b/Examples/33chartcreate-multiple-charts.php index 0e5ac60e2..f4a97a3ad 100644 --- a/Examples/33chartcreate-multiple-charts.php +++ b/Examples/33chartcreate-multiple-charts.php @@ -114,7 +114,7 @@ $legend1, // legend $plotArea1, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel1 // yAxisLabel ); @@ -191,7 +191,7 @@ $legend2, // legend $plotArea2, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel2 // yAxisLabel ); diff --git a/Examples/33chartcreate-pie.php b/Examples/33chartcreate-pie.php index 78b6293f8..0acd0d046 100644 --- a/Examples/33chartcreate-pie.php +++ b/Examples/33chartcreate-pie.php @@ -114,7 +114,7 @@ $legend1, // legend $plotArea1, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel NULL // yAxisLabel - Pie charts don't have a Y-Axis ); @@ -186,7 +186,7 @@ NULL, // legend $plotArea2, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel NULL // yAxisLabel - Like Pie charts, Donut charts don't have a Y-Axis ); diff --git a/Examples/33chartcreate-radar.php b/Examples/33chartcreate-radar.php index 0c28addf0..f5cc60890 100644 --- a/Examples/33chartcreate-radar.php +++ b/Examples/33chartcreate-radar.php @@ -125,7 +125,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel NULL // yAxisLabel - Radar charts don't have a Y-Axis ); diff --git a/Examples/33chartcreate-scatter.php b/Examples/33chartcreate-scatter.php index 7fc5b5ad4..f6965e4ec 100644 --- a/Examples/33chartcreate-scatter.php +++ b/Examples/33chartcreate-scatter.php @@ -109,7 +109,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero NULL, // xAxisLabel $yAxisLabel // yAxisLabel ); diff --git a/Examples/33chartcreate-stock.php b/Examples/33chartcreate-stock.php index 465107b3a..ca8b49b2b 100644 --- a/Examples/33chartcreate-stock.php +++ b/Examples/33chartcreate-stock.php @@ -118,7 +118,7 @@ $legend, // legend $plotArea, // plotArea true, // plotVisibleOnly - 0, // displayBlanksAs + 'gap', // displayBlanksAs: gap, span, zero $xAxisLabel, // xAxisLabel $yAxisLabel // yAxisLabel ); From 9be4060043774b2349f83b18329940a880230895 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Mon, 24 Aug 2015 15:06:13 +0100 Subject: [PATCH 2/2] Enable setting got the maximum value for chart axis --- Classes/PHPExcel/Chart/Axis.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/PHPExcel/Chart/Axis.php b/Classes/PHPExcel/Chart/Axis.php index 9aeafc6a4..246993919 100644 --- a/Classes/PHPExcel/Chart/Axis.php +++ b/Classes/PHPExcel/Chart/Axis.php @@ -191,6 +191,11 @@ public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value ($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null; } + public function setAxisMaximum($maximum) + { + ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null; + } + /** * Get Axis Options Property *