You are here

function pChart::validateDataDescription in Visitors 8

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

... See full list

File

pchart/pChart.inc, line 2501

Class

pChart

Code

function validateDataDescription($FunctionName, &$DataDescription, $DescriptionRequired = TRUE) {
  if (!isset($DataDescription["Position"])) {
    $this->Errors[] = "[Warning] " . $FunctionName . " - Y Labels are not set.";
    $DataDescription["Position"] = "Name";
  }
  if ($DescriptionRequired) {
    if (!isset($DataDescription["Description"])) {
      $this->Errors[] = "[Warning] " . $FunctionName . " - Series descriptions are not set.";
      foreach ($DataDescription["Values"] as $key => $Value) {
        $DataDescription["Description"][$Value] = $Value;
      }
    }
    if (count($DataDescription["Description"]) < count($DataDescription["Values"])) {
      $this->Errors[] = "[Warning] " . $FunctionName . " - Some series descriptions are not set.";
      foreach ($DataDescription["Values"] as $key => $Value) {
        if (!isset($DataDescription["Description"][$Value])) {
          $DataDescription["Description"][$Value] = $Value;
        }
      }
    }
  }
}