jackfiallos / pChart4Yii

pChart Wrapper for Yii Framework
http://jackfiallos.com
2 stars 1 forks source link

problem with generating graph when points have only 1 Labels #1

Open Zimon88 opened 13 years ago

Zimon88 commented 13 years ago

Points Array ( [Serie1] => Array ( [2009] => 0 )

[Serie2] => Array
    (
        [2009] => 0
    )

[Serie3] => Array
    (
        [2009] => 0
    )

[Serie4] => Array
    (
        [2009] => 0
    )

) Labels Array ( [0] => 2009 ) Series Array ( [Serie1] => Przeciagniety [Serie2] => Zapisany [Serie3] => Uzyty na blogu [Serie4] => Wyswietlony z przekierowania ) PHP Error

Opis

Invalid argument supplied for foreach()

Plik źródłowy

C:\xampp\htdocs\mercando\protected\extensions\pchartlib\pChart\pData.class.php(142)

00130: } 00131: 00132: if ( count($Value) == 1 ) 00133: { 00134: $this->Data[$ID][$Serie] = $Value; 00135: if ( $Description != "" ) 00136: $this->Data[$ID]["Name"] = $Description; 00137: elseif (!isset($this->Data[$ID]["Name"])) 00138: $this->Data[$ID]["Name"] = $ID; 00139: } 00140: else 00141: { 00142: foreach($Value as $key => $Val) 00143: { 00144: $this->Data[$ID][$Serie] = $Val; 00145: if (!isset($this->Data[$ID]["Name"])) 00146: $this->Data[$ID]["Name"] = $ID; 00147: $ID++; 00148: } 00149: } 00150: } 00151: 00152: function AddSerie($SerieName="Serie1") 00153: { 00154: if ( !isset($this->DataDescription["Values"]) ) Stack Trace

0 C:\xampp\htdocs\mercando\protected\controllers\ProductstatController.php(325): pData4Yii->AddPoint()

1 C:\xampp\htdocs\mercando\protected\controllers\ProductstatController.php(317): ProductstatController->drawGraph()

2 C:\xampp\htdocs\yii\framework\web\actions\CInlineAction.php(57): ProductstatController->actionDrawGraph()

3 C:\xampp\htdocs\yii\framework\web\CController.php(300): CInlineAction->run()

4 C:\xampp\htdocs\yii\framework\web\filters\CFilterChain.php(133): ProductstatController->runAction()

5 C:\xampp\htdocs\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()

6 C:\xampp\htdocs\mercando\protected\components\RightsBaseController.php(36): RightsFilter->filter()

7 C:\xampp\htdocs\yii\framework\web\filters\CInlineFilter.php(59): ProductstatController->filterRights()

8 C:\xampp\htdocs\yii\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter()

9 C:\xampp\htdocs\yii\framework\web\CController.php(283): CFilterChain->run()

10 C:\xampp\htdocs\yii\framework\web\CController.php(257): ProductstatController->runActionWithFilters()

11 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(324): ProductstatController->run()

12 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(121): CWebApplication->runController()

13 C:\xampp\htdocs\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()

14 C:\xampp\htdocs\mercando\index.php(45): CWebApplication->run()

When i add another part of points for examlpe for 2010 problem doesnt exist. Its appear only with 1 series of points

jackfiallos commented 13 years ago

Could you send me code implementation to see how your doing ?