diff options
Diffstat (limited to 'plugins/CoreVisualizations/Visualizations/Sparklines/Config.php')
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/Sparklines/Config.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php b/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php index 70100f6896..6557abb44b 100644 --- a/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php +++ b/plugins/CoreVisualizations/Visualizations/Sparklines/Config.php @@ -204,9 +204,17 @@ class Config extends \Piwik\ViewDataTable\Config $description = array($description); } + if (!empty($requestParamsForSparkline['columns']) + && count($requestParamsForSparkline['columns']) === count($values)) { + $columns = array_values($requestParamsForSparkline['columns']); + } else { + $columns = array(); + } + if (count($values) === count($description)) { foreach ($values as $index => $value) { $metrics[] = array( + 'column' => isset($columns[$index]) ? $columns[$index] : '', 'value' => $value, 'description' => $description[$index] ); |