Merge branch 'ent-7473-11796-mala-representacion-de-percentil-en-graficas-personalizadas' into 'develop'

fixed error with percentiles in graphs

See merge request artica/pandorafms!4312
This commit is contained in:
Daniel Rodriguez 2021-09-21 13:18:18 +00:00
commit b02ecc7cae
1 changed files with 3 additions and 1 deletions

View File

@ -3299,8 +3299,10 @@ function extract_column($array, $column)
function get_percentile($percentile, $array)
{
global $config;
sort($array);
$index = (($percentile / 100) * count($array));
$index = (($config['percentil'] / 100) * count($array));
if (floor($index) == $index) {
$result = (($array[($index - 1)] + $array[$index]) / 2);