Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhang <peter@innocraft.com>2022-01-28 04:29:18 +0300
committerGitHub <noreply@github.com>2022-01-28 04:29:18 +0300
commit8ae9c53fc19824b22467f9baab477fb4e7f05967 (patch)
tree3acab4cbf0bd50c8a6a7314c6068b5a2a29cc545
parent55d006a49cdabb53524d6128aec54cab14df10a7 (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.php6
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') {