/** * A Static function that return the amount of points you need * @param array $data an array containing the points * @param int $amount the number of points you want to get * @param bool $ordered (optional) wether you want the points ordered by priority values or not (if not they will be ordered by abscissa values). Default is false. * @param string|int $x (optional) key of the abscissa values in each element of your data, default is 'x' * @param string|int $y (optional) key of the ordinate values in each element of your data, default is 'y' * @param string|int $priority (optional) key of the priority value in each element of data returned, default is 'priority' * @return array an array containing the filtered points */ public static function filterPoints($data, $amount, $ordered = false, $x = 'x', $y = 'y', $priority = 'priority') { $Vis = new self($data, $x, $y, $priority); if ($ordered) { return $Vis->getOrderedData($amount); } return $Vis->getData($amount); }