function pData::addPoints

5.x pData.class.php pData::addPoints($Values, $SerieName = "Serie1")
3 calls to pData::addPoints()
pData::addRandomValues in inc/pchart/pchart/class/pData.class.php
pData::createFunctionSerie in inc/pchart/pchart/class/pData.class.php
pData::importFromCSV in inc/pchart/pchart/class/pData.class.php

File

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

Class

pData

Code

function addPoints($Values, $SerieName = "Serie1") 
 {
  if (!isset($this->Data ["Series"][$SerieName])) {
    $this->initialise($SerieName);
  }

  if (is_array($Values)) 
   {
    foreach ($Values as $Key => $Value) 
     {
      $this->Data ["Series"][$SerieName]["Data"][] = $Value;
    }
  }
  else {
    $this->Data ["Series"][$SerieName]["Data"][] = $Values;
  }

  if ($Values != VOID) 
   {
    $StrippedData = $this->stripVOID($this->Data ["Series"][$SerieName]["Data"]);
    if (empty($StrippedData)) {
      $this->Data ["Series"][$SerieName]["Max"] = 0;
      $this->Data ["Series"][$SerieName]["Min"] = 0;
      return (0);
    }
    $this->Data ["Series"][$SerieName]["Max"] = max($StrippedData);
    $this->Data ["Series"][$SerieName]["Min"] = min($StrippedData);
  }
}