diff --git a/src/Dashboard/Widget.php b/src/Dashboard/Widget.php index 880b56330e9..9a8349ca9d7 100644 --- a/src/Dashboard/Widget.php +++ b/src/Dashboard/Widget.php @@ -543,7 +543,7 @@ public static function pie(array $params = []): string $dark_bg_color = Toolbox::getFgColor($p['color'], 80); $dark_fg_color = Toolbox::getFgColor($p['color'], 40); - $chart_id = "chart-{$p['cache_key']}"; + $chart_id = Toolbox::slugify("chart-{$p['cache_key']}"); $class = "pie"; $class .= $p['half'] ? " half" : ""; @@ -1038,7 +1038,7 @@ private static function getBarsGraph( $animation_duration = self::$animation_duration; - $chart_id = 'chart_' . $p['cache_key']; + $chart_id = Toolbox::slugify('chart_' . $p['cache_key']); $class = "bar"; $class .= $p['horizontal'] ? " horizontal" : ""; @@ -1484,7 +1484,7 @@ private static function getLinesGraph( $json_labels = json_encode($labels); $json_series = json_encode($series); - $chart_id = 'chart_' . $p['cache_key']; + $chart_id = Toolbox::slugify('chart_' . $p['cache_key']); $fg_color = Toolbox::getFgColor($p['color']); $line_color = Toolbox::getFgColor($p['color'], 10);