From f65dfa951ecaf42e53c5e30a3d81356cc4ff2090 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 28 Mar 2012 12:02:24 +0000 Subject: [PATCH] Fix when format is not defined for data series values, thanks to pnomolos git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@88558 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/Excel2007/Chart.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index 35ca564d..e5bf00db 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Chart.php +++ b/Classes/PHPExcel/Writer/Excel2007/Chart.php @@ -940,9 +940,11 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa ($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) { - $objWriter->startElement('c:formatCode'); - $objWriter->writeRawData( $plotSeriesValues->getFormatCode() ); - $objWriter->endElement(); + if ($plotSeriesValues->getFormatCode() !== NULL) { + $objWriter->startElement('c:formatCode'); + $objWriter->writeRawData( $plotSeriesValues->getFormatCode() ); + $objWriter->endElement(); + } } $objWriter->startElement('c:ptCount');