diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index 3e5c350..4a29a59 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Chart.php +++ b/Classes/PHPExcel/Writer/Excel2007/Chart.php @@ -849,7 +849,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa } if ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { - $this->_writeBubbles($plotSeriesValues, $objWriter); + $this->_writeBubbles($plotSeriesValues, $objWriter, $pSheet); } $objWriter->endElement(); @@ -975,15 +975,17 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa $dataValues = $plotSeriesValues->getDataValues(); if (!empty($dataValues)) { - if (!is_array($dataValues)) { - $dataValues = PHPExcel_Calculation_Functions::flattenArray( - PHPExcel_Calculation::getInstance() - ->calculateFormula('='.$dataValues, - NULL, - $pSheet->getCell('A1') - ) - ); - } +// if (!is_array($dataValues)) { +// echo 'NOT AN ARRAY: '; +// var_dump($dataValues); +// $dataValues = PHPExcel_Calculation_Functions::flattenArray( +// PHPExcel_Calculation::getInstance() +// ->calculateFormula('='.$dataValues, +// NULL, +// $pSheet->getCell('A1') +// ) +// ); +// } if (is_array($dataValues)) { foreach($dataValues as $plotSeriesKey => $plotSeriesValue) { $objWriter->startElement('c:pt'); @@ -1010,7 +1012,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @throws Exception */ - private function _writeBubbles($plotSeriesValues, $objWriter) + private function _writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet) { if (is_null($plotSeriesValues)) { return; @@ -1027,13 +1029,29 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa $objWriter->writeAttribute('val', $plotSeriesValues->getPointCount() ); $objWriter->endElement(); - foreach($plotSeriesValues->getDataValues() as $plotSeriesKey => $plotSeriesValue) { - $objWriter->startElement('c:pt'); - $objWriter->writeAttribute('idx', $plotSeriesKey ); - $objWriter->startElement('c:v'); - $objWriter->writeRawData( 1 ); - $objWriter->endElement(); - $objWriter->endElement(); + $dataValues = $plotSeriesValues->getDataValues(); + if (!empty($dataValues)) { +// if (!is_array($dataValues)) { +// echo 'NOT AN ARRAY: '; +// var_dump($dataValues); +// $dataValues = PHPExcel_Calculation_Functions::flattenArray( +// PHPExcel_Calculation::getInstance() +// ->calculateFormula('='.$dataValues, +// NULL, +// $pSheet->getCell('A1') +// ) +// ); +// } + if (is_array($dataValues)) { + foreach($dataValues as $plotSeriesKey => $plotSeriesValue) { + $objWriter->startElement('c:pt'); + $objWriter->writeAttribute('idx', $plotSeriesKey ); + $objWriter->startElement('c:v'); + $objWriter->writeRawData( 1 ); + $objWriter->endElement(); + $objWriter->endElement(); + } + } } $objWriter->endElement(); diff --git a/Tests/templates/32readwriteChartColours1.xlsx b/Tests/templates/32readwriteChartColours1.xlsx deleted file mode 100644 index 7449f3f..0000000 Binary files a/Tests/templates/32readwriteChartColours1.xlsx and /dev/null differ diff --git a/Tests/templates/32readwriteChartLegends1.xlsx b/Tests/templates/32readwriteChartLegends1.xlsx deleted file mode 100644 index 140638c..0000000 Binary files a/Tests/templates/32readwriteChartLegends1.xlsx and /dev/null differ diff --git a/Tests/templates/32readwriteChartTypes1.xlsx b/Tests/templates/32readwriteChartTypes1.xlsx deleted file mode 100644 index 14800c6..0000000 Binary files a/Tests/templates/32readwriteChartTypes1.xlsx and /dev/null differ diff --git a/Tests/templates/32readwriteColumnChart3D2.xlsx b/Tests/templates/32readwriteColumnChart3D2.xlsx deleted file mode 100644 index af5763e..0000000 Binary files a/Tests/templates/32readwriteColumnChart3D2.xlsx and /dev/null differ