Skip to content

Commit 4491898

Browse files
committed
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
1 parent 7fa1609 commit 4491898

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Classes/PHPExcel/Writer/Excel2007/Chart.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,6 @@ private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $
540540
}
541541

542542
$objWriter->startElement('c:scaling');
543-
$objWriter->startElement('c:orientation');
544-
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation'));
545543

546544
if (!is_null($xAxis->getAxisOptionsProperty('maximum'))) {
547545
$objWriter->startElement('c:max');
@@ -555,6 +553,10 @@ private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $
555553
$objWriter->endElement();
556554
}
557555

556+
$objWriter->startElement('c:orientation');
557+
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation'));
558+
559+
558560
$objWriter->endElement();
559561
$objWriter->endElement();
560562

0 commit comments

Comments
 (0)