From 11c79cd6da1cf4824e1a48d98d0b5935b1a22351 Mon Sep 17 00:00:00 2001 From: mingozh <77652617+mingozh@users.noreply.github.com> Date: Fri, 29 Jul 2022 04:56:12 +0800 Subject: [PATCH] BarchartPanel: Fix color from thresholds show incorrectly (#52038) Signed-off-by: Kyle Cunningham --- public/app/plugins/panel/barchart/BarChartPanel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/barchart/BarChartPanel.tsx b/public/app/plugins/panel/barchart/BarChartPanel.tsx index a9851074458..ff53d1abd9a 100644 --- a/public/app/plugins/panel/barchart/BarChartPanel.tsx +++ b/public/app/plugins/panel/barchart/BarChartPanel.tsx @@ -205,7 +205,7 @@ export const BarChartPanel: React.FunctionComponent = ({ }; // Color by value - let getColor: ((seriesIdx: number, valueIdx: number) => string) | undefined = undefined; + let getColor: ((seriesIdx: number, valueIdx: number, value: any) => string) | undefined = undefined; let fillOpacity = 1; @@ -214,7 +214,7 @@ export const BarChartPanel: React.FunctionComponent = ({ const disp = colorByField.display!; fillOpacity = (colorByField.config.custom.fillOpacity ?? 100) / 100; // gradientMode? ignore? - getColor = (seriesIdx: number, valueIdx: number) => disp(colorByField.values.get(valueIdx)).color!; + getColor = (seriesIdx: number, valueIdx: number, value: any) => disp(value).color!; } const prepConfig = (alignedFrame: DataFrame, allFrames: DataFrame[], getTimeRange: () => TimeRange) => {