diff options
author | Peter Zhang <peter@innocraft.com> | 2022-01-31 07:41:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 07:41:10 +0300 |
commit | 533a243ac58f3bf7ab3bad1d28f11e6839752ecd (patch) | |
tree | bd9046ec3940f579000bd0ff76ca19a0a2ad8720 | |
parent | c4f5733ebef7e59bbc78a9bbae1e2b51fb9a3b83 (diff) |
Cp 18534 fix (#18703)
* set default color value, when key not exist. (#18696)
* Update Sparkline.php
add addition setup
* Update Sparkline.php
update foreach to array_merge
* 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') { |