How to set the X-Axis Labels with PHPExcel_RichText ?

Nov 16, 2012 at 5:48 AM
Edited Nov 16, 2012 at 6:06 AM

Hi

I want to set the X-Axis Labels by PHPExcel_RichText. But, I got the Error following:

 

PHP Fatal error:  Cannot use object of type PHPExcel_RichText as array in local/project/fbrep/app/Vendor/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php on line 293

Fatal error: Cannot use object of type PHPExcel_RichText as array in local/project/fbrep/app/Vendor/PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php on line 293

 

Please tell me how to proceed.

I use:

  • PHPExcel: latest (I git clone yesterday.)
  • PHP: 5.4.5

Thanks.

Nov 16, 2012 at 8:02 AM
Edited Nov 16, 2012 at 8:05 AM

Hi

I tried to fix PHPExcel/Classes/PHPExcel/Chart/DataSeriesValues.php
before:

292                 foreach($this->_dataValues as &$dataValue) {
293                     if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
294                         $dataValue = 0.0;
295                     } 
296                 }

 

after:

292                 foreach($this->_dataValues as &$dataValue) {
293                     if ((!empty($dataValue)) && !(is_object($dataValue)) && ($dataValue[0] == '#')) {
294                         $dataValue = 0.0;
295                     }
296                 }

 

and then I execute my script , that error does not occured.
is my fix correct?

thanks.