You are here

function pChart::validateData in Visitors 8

Same name and namespace in other branches
  1. 7.0 pchart/pChart.inc \pChart::validateData()
20 calls to pChart::validateData()
pChart::drawArea in pchart/pChart.inc
pChart::drawBarGraph in pchart/pChart.inc
pChart::drawBasicPieGraph in pchart/pChart.inc
pChart::drawCubicCurve in pchart/pChart.inc
pChart::drawFilledCubicCurve in pchart/pChart.inc

... See full list

File

pchart/pChart.inc, line 2533

Class

pChart

Code

function validateData($FunctionName, &$Data) {
  $DataSummary = "";
  foreach ($Data as $key => $Values) {
    foreach ($Values as $key2 => $Value) {
      if (!isset($DataSummary[$key2])) {
        $DataSummary[$key2] = 1;
      }
      else {
        $DataSummary[$key2]++;
      }
    }
  }
  if (max($DataSummary) == 0) {
    $this->Errors[] = "[Warning] " . $FunctionName . " - No data set.";
  }
  foreach ($DataSummary as $key => $Value) {
    if ($Value < max($DataSummary)) {
      $this->Errors[] = "[Warning] " . $FunctionName . " - Missing data in serie " . $key . ".";
    }
  }
}