From 44918984a1b938c311699cd79918a01c1d4fa392 Mon Sep 17 00:00:00 2001 From: Vitaly Repin Date: Thu, 24 Mar 2016 00:45:27 +0200 Subject: [PATCH] Bug fix: c:max and c:min elements must not be inside c:orientation elements. They shall be inside c:scaling elements. Otherwise they are ignored by Excel and Libreoffice --- Classes/PHPExcel/Writer/Excel2007/Chart.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index c0f86bf..92fa215 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Chart.php +++ b/Classes/PHPExcel/Writer/Excel2007/Chart.php @@ -540,8 +540,6 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa } $objWriter->startElement('c:scaling'); - $objWriter->startElement('c:orientation'); - $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation')); if (!is_null($xAxis->getAxisOptionsProperty('maximum'))) { $objWriter->startElement('c:max'); @@ -555,6 +553,10 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa $objWriter->endElement(); } + $objWriter->startElement('c:orientation'); + $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation')); + + $objWriter->endElement(); $objWriter->endElement();