function pData::getGeometricMean

5.x pData.class.php pData::getGeometricMean($Serie)

File

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

Class

pData

Code

function getGeometricMean($Serie) 
 {
  if (isset($this->Data ["Series"][$Serie])) 
   {
    $SerieData = $this->stripVOID($this->Data ["Series"][$Serie]["Data"]);
    $Seriesum = 1;
    foreach ($SerieData as $Key => $Value) {
      $Seriesum = $Seriesum * $Value;
    }
    return (pow($Seriesum, 1 / sizeof($SerieData)));
  }
  else {
    return (NULL);
  }
}