function pData::getSeriePercentile in Visitors 7.2
Same name and namespace in other branches
- 7 pChart/class/pData.class.php \pData::getSeriePercentile()
File
- pChart/
class/ pData.class.php, line 364
Class
Code
function getSeriePercentile($Serie = "Serie1", $Percentil = 95) {
if (!isset($this->Data["Series"][$Serie]["Data"])) {
return NULL;
}
$Values = count($this->Data["Series"][$Serie]["Data"]) - 1;
if ($Values < 0) {
$Values = 0;
}
$PercentilID = floor($Values / 100 * $Percentil + 0.5);
$SortedValues = $this->Data["Series"][$Serie]["Data"];
sort($SortedValues);
if (is_numeric($SortedValues[$PercentilID])) {
return $SortedValues[$PercentilID];
}
else {
return NULL;
}
}