@@ -849,7 +849,7 @@ private function _writePlotGroup( $plotGroup,
849
849
}
850
850
851
851
if ($ groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART ) {
852
- $ this ->_writeBubbles ($ plotSeriesValues , $ objWriter );
852
+ $ this ->_writeBubbles ($ plotSeriesValues , $ objWriter, $ pSheet );
853
853
}
854
854
855
855
$ objWriter ->endElement ();
@@ -975,15 +975,17 @@ private function _writePlotSeriesValues( $plotSeriesValues,
975
975
976
976
$ dataValues = $ plotSeriesValues ->getDataValues ();
977
977
if (!empty ($ dataValues )) {
978
- if (!is_array ($ dataValues )) {
979
- $ dataValues = PHPExcel_Calculation_Functions::flattenArray (
980
- PHPExcel_Calculation::getInstance ()
981
- ->calculateFormula ('= ' .$ dataValues ,
982
- NULL ,
983
- $ pSheet ->getCell ('A1 ' )
984
- )
985
- );
986
- }
978
+ // if (!is_array($dataValues)) {
979
+ // echo 'NOT AN ARRAY: ';
980
+ // var_dump($dataValues);
981
+ // $dataValues = PHPExcel_Calculation_Functions::flattenArray(
982
+ // PHPExcel_Calculation::getInstance()
983
+ // ->calculateFormula('='.$dataValues,
984
+ // NULL,
985
+ // $pSheet->getCell('A1')
986
+ // )
987
+ // );
988
+ // }
987
989
if (is_array ($ dataValues )) {
988
990
foreach ($ dataValues as $ plotSeriesKey => $ plotSeriesValue ) {
989
991
$ objWriter ->startElement ('c:pt ' );
@@ -1010,7 +1012,7 @@ private function _writePlotSeriesValues( $plotSeriesValues,
1010
1012
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
1011
1013
* @throws Exception
1012
1014
*/
1013
- private function _writeBubbles ($ plotSeriesValues , $ objWriter )
1015
+ private function _writeBubbles ($ plotSeriesValues , $ objWriter, PHPExcel_Worksheet $ pSheet )
1014
1016
{
1015
1017
if (is_null ($ plotSeriesValues )) {
1016
1018
return ;
@@ -1027,13 +1029,29 @@ private function _writeBubbles($plotSeriesValues, $objWriter)
1027
1029
$ objWriter ->writeAttribute ('val ' , $ plotSeriesValues ->getPointCount () );
1028
1030
$ objWriter ->endElement ();
1029
1031
1030
- foreach ($ plotSeriesValues ->getDataValues () as $ plotSeriesKey => $ plotSeriesValue ) {
1031
- $ objWriter ->startElement ('c:pt ' );
1032
- $ objWriter ->writeAttribute ('idx ' , $ plotSeriesKey );
1033
- $ objWriter ->startElement ('c:v ' );
1034
- $ objWriter ->writeRawData ( 1 );
1035
- $ objWriter ->endElement ();
1036
- $ objWriter ->endElement ();
1032
+ $ dataValues = $ plotSeriesValues ->getDataValues ();
1033
+ if (!empty ($ dataValues )) {
1034
+ // if (!is_array($dataValues)) {
1035
+ // echo 'NOT AN ARRAY: ';
1036
+ // var_dump($dataValues);
1037
+ // $dataValues = PHPExcel_Calculation_Functions::flattenArray(
1038
+ // PHPExcel_Calculation::getInstance()
1039
+ // ->calculateFormula('='.$dataValues,
1040
+ // NULL,
1041
+ // $pSheet->getCell('A1')
1042
+ // )
1043
+ // );
1044
+ // }
1045
+ if (is_array ($ dataValues )) {
1046
+ foreach ($ dataValues as $ plotSeriesKey => $ plotSeriesValue ) {
1047
+ $ objWriter ->startElement ('c:pt ' );
1048
+ $ objWriter ->writeAttribute ('idx ' , $ plotSeriesKey );
1049
+ $ objWriter ->startElement ('c:v ' );
1050
+ $ objWriter ->writeRawData ( 1 );
1051
+ $ objWriter ->endElement ();
1052
+ $ objWriter ->endElement ();
1053
+ }
1054
+ }
1037
1055
}
1038
1056
1039
1057
$ objWriter ->endElement ();
0 commit comments