You are here

function pData::negateValues in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pData.class.php \pData::negateValues()

File

pChart/class/pData.class.php, line 734

Class

pData

Code

function negateValues($Series) {
  if (!is_array($Series)) {
    $Series = $this
      ->convertToArray($Series);
  }
  foreach ($Series as $Key => $SerieName) {
    if (isset($this->Data["Series"][$SerieName])) {
      $Data = "";
      foreach ($this->Data["Series"][$SerieName]["Data"] as $Key => $Value) {
        if ($Value == VOID) {
          $Data[] = VOID;
        }
        else {
          $Data[] = -$Value;
        }
      }
      $this->Data["Series"][$SerieName]["Data"] = $Data;
      $this->Data["Series"][$SerieName]["Max"] = max($this
        ->stripVOID($this->Data["Series"][$SerieName]["Data"]));
      $this->Data["Series"][$SerieName]["Min"] = min($this
        ->stripVOID($this->Data["Series"][$SerieName]["Data"]));
    }
  }
}