public 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 + .5);
        $SortedValues = $this->Data["Series"][$Serie]["Data"];
        sort($SortedValues);

        if (is_numeric($SortedValues[$PercentilID])) {
            return $SortedValues[$PercentilID];
        }
        return null;
    }
public 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 + .5);
        $SortedValues = $this->Data["Series"][$Serie]["Data"];
        sort($SortedValues);

        if (is_numeric($SortedValues[$PercentilID])) {
            return $SortedValues[$PercentilID];
        }
        return null;
    }
public 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 + .5 ) ; $ SortedValues = $ this -> Data [ "Series" ] [ $ Serie ] [ "Data" ] ; sort ( $ SortedValues ) ; if ( is_numeric ( $ SortedValues [ $ PercentilID ] ) ) { return $ SortedValues [ $ PercentilID ] ; } return null ; }
Return the x th percentil of the given serie
@param string $Serie
@param int $Percentil
@return int|float| null
Return the x th percentil of the given serie