function pData::getHarmonicMean

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

File

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

Class

pData

Code

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