Error on creating chart

Topics: Developer Forum
Dec 13, 2012 at 10:36 AM

Hello,

         First of all thank you so much for PHPExcel. I am getting below error on creating chart :

Fatal error: Call to a member function cellExists() on a non-object in /opt/lampp/htdocs/scgcc/Classes/PHPExcel/Calculation.php on line 3241

This error is occurring on  $objWorksheet->addChart($chart);

Chart variable return below :

PHPExcel_Chart Object
(
    [_name:PHPExcel_Chart:private] => chart1
    [_worksheet:PHPExcel_Chart:private] => 
    [_title:PHPExcel_Chart:private] => PHPExcel_Chart_Title Object
        (
            [_caption:PHPExcel_Chart_Title:private] => Test Stacked Line Chart
            [_layout:PHPExcel_Chart_Title:private] => 
        )

    [_legend:PHPExcel_Chart:private] => PHPExcel_Chart_Legend Object
        (
            [_position:PHPExcel_Chart_Legend:private] => tr
            [_overlay:PHPExcel_Chart_Legend:private] => 
            [_layout:PHPExcel_Chart_Legend:private] => 
        )

    [_xAxisLabel:PHPExcel_Chart:private] => 
    [_yAxisLabel:PHPExcel_Chart:private] => PHPExcel_Chart_Title Object
        (
            [_caption:PHPExcel_Chart_Title:private] => Value ($k)
            [_layout:PHPExcel_Chart_Title:private] => 
        )

    [_plotArea:PHPExcel_Chart:private] => PHPExcel_Chart_PlotArea Object
        (
            [_layout:PHPExcel_Chart_PlotArea:private] => 
            [_plotSeries:PHPExcel_Chart_PlotArea:private] => Array
                (
                    [0] => PHPExcel_Chart_DataSeries Object
                        (
                            [_plotType:PHPExcel_Chart_DataSeries:private] => lineChart
                            [_plotGrouping:PHPExcel_Chart_DataSeries:private] => stacked
                            [_plotDirection:PHPExcel_Chart_DataSeries:private] => 
                            [_plotStyle:PHPExcel_Chart_DataSeries:private] => 
                            [_plotOrder:PHPExcel_Chart_DataSeries:private] => Array
                                (
                                    [0] => 0
                                    [1] => 1
                                    [2] => 2
                                    [3] => 3
                                )

                            [_plotLabel:PHPExcel_Chart_DataSeries:private] => Array
                                (
                                    [0] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$B$1
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [1] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$C$1
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [2] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$D$1
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [3] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$E$1
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 1
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                )

                            [_plotCategory:PHPExcel_Chart_DataSeries:private] => Array
                                (
                                    [0] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => String
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$A$2:$A$6
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                )

                            [_smoothLine:PHPExcel_Chart_DataSeries:private] => 
                            [_plotValues:PHPExcel_Chart_DataSeries:private] => Array
                                (
                                    [0] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$B$2:$B$6
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [1] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$C$2:$C$6
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [2] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$D$2:$D$6
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                    [3] => PHPExcel_Chart_DataSeriesValues Object
                                        (
                                            [_dataType:PHPExcel_Chart_DataSeriesValues:private] => Number
                                            [_dataSource:PHPExcel_Chart_DataSeriesValues:private] => Worksheet!$E$2:$E$6
                                            [_formatCode:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_marker:PHPExcel_Chart_DataSeriesValues:private] => 
                                            [_pointCount:PHPExcel_Chart_DataSeriesValues:private] => 5
                                            [_dataValues:PHPExcel_Chart_DataSeriesValues:private] => Array
                                                (
                                                )

                                        )

                                )

                        )

                )

        )

    [_plotVisibleOnly:PHPExcel_Chart:private] => 1
    [_displayBlanksAs:PHPExcel_Chart:private] => 0
    [_topLeftCellRef:PHPExcel_Chart:private] => A13
    [_topLeftXOffset:PHPExcel_Chart:private] => 0
    [_topLeftYOffset:PHPExcel_Chart:private] => 0
    [_bottomRightCellRef:PHPExcel_Chart:private] => H30
    [_bottomRightXOffset:PHPExcel_Chart:private] => 10
    [_bottomRightYOffset:PHPExcel_Chart:private] => 10
)

Please reply me, Its very urgent.

Thanks

Dec 13, 2012 at 12:23 PM

Any one..... ??

Dec 13, 2012 at 12:51 PM

I have been resolve that error issue but now there are no values showing in graph ....

Dec 13, 2012 at 1:04 PM

Please tell me one more thing that whether chart work on decimal values [Like 22.65 ] or not ?

Dec 14, 2012 at 7:25 AM

I have been resolve this issue. But now chart lines are not appearing, for that you can refer screenshot @ uvresins.net/images/xls.png and my chart variable is same as i am mentioning above. I dont know what i am missing. can you please give me any solution / hints. Please help.

Sep 11, 2013 at 3:19 PM
this your code or of one library??

to me was the same, and that is the name of cells that do not exist in the worksheet