function pData::getHarmonicMean in Visitors 7
Same name and namespace in other branches
- 7.2 pChart/class/pData.class.php \pData::getHarmonicMean()
File
- pChart/
class/ pData.class.php, line 296
Class
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;
}
}