PHP warning

count(): Parameter must be an array or an object that implements Countable

/var/www/html/LimeSurvey/application/third_party/pchart/pData.class.php(129)

117       }
118     }
119 
120    function AddPoint($Value,$Serie="Serie1",$Description="")
121     {
122      if (is_array($Value) && count($Value) == 1)
123       $Value = $Value[0];
124 
125      $ID = 0;
126      for($i=0;$i<=count($this->Data);$i++)
127       { if( isset($this->Data[$i]) && isset($this->Data[$i][$Serie])) { $ID = $i+1; } }
128 
129      if ( count($Value) == 1 )
130       {
131        $this->Data[$ID][$Serie] = $Value;
132        if ( $Description != "" )
133         $this->Data[$ID]["Name"] = $Description;
134        elseif (!isset($this->Data[$ID]["Name"]))
135         $this->Data[$ID]["Name"] = $ID;
136       }
137      else
138       {
139        foreach($Value as $key => $Val)
140         {
141          $this->Data[$ID][$Serie] = $Val;

Stack Trace

#0
+
 /var/www/html/LimeSurvey/application/helpers/admin/statistics_helper.php(120): pData->AddPoint("0", "Serie0")
115             // Bar chart
116             $DataSet = new pData;
117             $counter = 0;
118             $maxyvalue = 0;
119             foreach ($grawdata as $datapoint) {
120                 $DataSet->AddPoint(array($datapoint), 'Serie'.$counter);
121                 $DataSet->AddSerie("Serie".$counter);
122 
123                 $counter++;
124                 if ($datapoint > $maxyvalue) {
125                     $maxyvalue = $datapoint;
#1
+
 /var/www/html/LimeSurvey/application/helpers/admin/statistics_helper.php(3295): createChart("1014", "797853", false, array("SQ001", "SQ002", "SQ003"), ...)
3290                     if (count($lbl) == count($outputs['alist']) + 1) {
3291                         end($lbl);
3292                         $graphLbl[] = key($lbl);
3293                         reset($lbl);
3294                     }
3295                     $cachefilename = createChart($qqid, $qsid, $bShowPieChart, $graphLbl, $gdata, $grawdata, $MyCache, $sLanguage, $outputs['qtype']);
3296                 }
3297 
3298                 if ($cachefilename || $outputType == 'html') {
3299                     // Add the image only if constructed
3300                     //introduce new counter
#2
+
 /var/www/html/LimeSurvey/application/helpers/admin/statistics_helper.php(4060): statistics_helper->displayResults(array("alist" => array(array("SQ001", "111", "797853X138X1014SQ001"), array("SQ002", "222", "797853X138X1014SQ002"), array("SQ003", "333", "797853X138X1014SQ003")), "qtitle" => "ex1", "qquestion" => "", "qtype" => "M", ...), "1", "M797853X138X1014", "pdf", ...)
4055                 $outputs = $this->buildOutputList($rt, $language, $surveyid, $outputType, $sql, $sLanguageCode);
4056                 $sOutputHTML .= $outputs['statisticsoutput'];
4057                 //2. Collect and Display results #######################################################################
4058                 if (isset($outputs['alist']) && $outputs['alist']) {
4059                     //Make sure there really is an answerlist, and if so:
4060                     $display = $this->displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $usegraph, $browse, $sLanguageCode);
4061                     $sOutputHTML .= $display['statisticsoutput'];
4062                     $aStatisticsData = array_merge($aStatisticsData, $display['astatdata']);
4063                 }    //end if -> collect and display results
4064 
4065 
2019-01-10 15:15:03 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.20