diff options
author | Peter Zhang <peter@innocraft.com> | 2022-01-28 04:29:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 04:29:18 +0300 |
commit | 8ae9c53fc19824b22467f9baab477fb4e7f05967 (patch) | |
tree | 3acab4cbf0bd50c8a6a7314c6068b5a2a29cc545 | |
parent | 55d006a49cdabb53524d6128aec54cab14df10a7 (diff) |
set default color value, when key not exist. (#18696)
* Update Sparkline.php
add addition setup
* Update Sparkline.php
update foreach to array_merge
-rw-r--r-- | core/Visualization/Sparkline.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Visualization/Sparkline.php b/core/Visualization/Sparkline.php index e3cff4fb11..1e9abb4484 100644 --- a/core/Visualization/Sparkline.php +++ b/core/Visualization/Sparkline.php @@ -177,8 +177,10 @@ class Sparkline implements ViewInterface 'fillColor' => '#ffffff' ); - if (empty($colors)) { // quick fix so row evolution sparklines will have color in widgetize's iframes - $colors = $defaultColors; + if (empty($colors)) { + $colors = $defaultColors; //set default color, if no color passed + } else { + $colors = array_merge($defaultColors, $colors); //set default color key, if no key set. } if (strtolower($colors['backgroundColor']) !== '#ffffff') { |