We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add random colors or shuffle colors in config file
public function setColors(array $colors) :LarapexChart
The text was updated successfully, but these errors were encountered:
You can do it for yourself with a simple class:
class RandomColor { public static function getRandomColors(int $count): array { $array = []; for ($i = 1; $i <= $count; $i++) { $array[] = self::getRandomColor(); } return $array; } private static function getRandomColor(): string { $color = '#'; for ($i = 1; $i <= 6; $i++) { $color .= self::getRandomColorElement(); } return $color; } private static function getRandomColorElement(): string { $colors = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; return $colors[array_rand($colors)]; } }
Then use it:
->setColors(RandomColor::getRandomColors(5))
Sorry, something went wrong.
As setColors() allows to add your custom array in any order, I think this is out of the scope for the package.
setColors()
No branches or pull requests
add random colors or shuffle colors in config file
public function setColors(array $colors) :LarapexChart
The text was updated successfully, but these errors were encountered: