From 974233bf81ad057ce82772180df0244eac8ee681 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Wed, 2 Dec 2020 14:21:39 +0100 Subject: [PATCH] Graph NG: Invalidate uPlot config on timezone changes (#29531) --- packages/grafana-ui/src/components/GraphNG/GraphNG.tsx | 2 +- packages/grafana-ui/src/components/uPlot/hooks.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx index 8ae6f641c86..411d7073b92 100755 --- a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx +++ b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx @@ -160,7 +160,7 @@ export const GraphNG: React.FC = ({ legendItemsRef.current = legendItems; return builder; - }, [configRev]); + }, [configRev, timeZone]); if (alignedFrameWithGapTest == null) { return ( diff --git a/packages/grafana-ui/src/components/uPlot/hooks.ts b/packages/grafana-ui/src/components/uPlot/hooks.ts index 1cb0e07dd1d..afa9a363534 100644 --- a/packages/grafana-ui/src/components/uPlot/hooks.ts +++ b/packages/grafana-ui/src/components/uPlot/hooks.ts @@ -105,7 +105,6 @@ export const DEFAULT_PLOT_CONFIG = { hooks: {}, }; -//pass plain confsig object,memoize! export const usePlotConfig = (width: number, height: number, timeZone: TimeZone, configBuilder: UPlotConfigBuilder) => { const { arePluginsReady, plugins, registerPlugin } = usePlotPlugins(); const [isConfigReady, setIsConfigReady] = useState(false);