From cf699d8ad1a034cf6f5e0110b93be734116f60ac Mon Sep 17 00:00:00 2001 From: Oscar Kilhed Date: Tue, 6 Apr 2021 13:35:44 +0200 Subject: [PATCH] Normalize color string before using them as IDs (#32713) --- packages/grafana-ui/src/components/PieChart/PieChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/PieChart/PieChart.tsx b/packages/grafana-ui/src/components/PieChart/PieChart.tsx index 7609507cb46..e1c63e5e3b4 100644 --- a/packages/grafana-ui/src/components/PieChart/PieChart.tsx +++ b/packages/grafana-ui/src/components/PieChart/PieChart.tsx @@ -144,7 +144,7 @@ export const PieChartSvg: FC = ({ } const getValue = (d: FieldDisplay) => d.display.numeric; - const getGradientId = (color: string) => `${componentInstanceId}-${color}`; + const getGradientId = (color: string) => `${componentInstanceId}-${tinycolor(color).toHex()}`; const getGradientColor = (color: string) => { return `url(#${getGradientId(color)})`; };