function pData::limits

5.x pData.class.php pData::limits()

File

inc/pchart/pchart/class/pData.class.php, line 247

Class

pData

Code

function limits() 
 {
  $GlobalMin = ABSOLUTE_MAX;
  $GlobalMax = ABSOLUTE_MIN;

  foreach ($this->Data ["Series"] as $Key => $Value) 
   {
    if ($this->Data ["Abscissa"] != $Key && $this->Data ["Series"][$Key]["isDrawable"] == TRUE) 
     {
      if ($GlobalMin > $this->Data ["Series"][$Key]["Min"]) {
        $GlobalMin = $this->Data ["Series"][$Key]["Min"];
      }
      if ($GlobalMax < $this->Data ["Series"][$Key]["Max"]) {
        $GlobalMax = $this->Data ["Series"][$Key]["Max"];
      }
    }
  }
  $this->Data ["Min"] = $GlobalMin;
  $this->Data ["Max"] = $GlobalMax;

  return (array($GlobalMin, $GlobalMax));
}