Candlestick: re-init config when series length changes (#56913) (#56930)

(cherry picked from commit 4eea326ee8)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-10-14 05:31:10 -04:00
committed by GitHub
co-authored by Leon Sorokin
parent 7d21e021ea
commit 0bdc74ba39
@@ -47,7 +47,7 @@ export const CandlestickPanel: React.FC<CandlestickPanelProps> = ({
const theme = useTheme2();
const info = useMemo(() => {
return prepareCandlestickFields(data?.series, options, theme, timeRange);
return prepareCandlestickFields(data.series, options, theme, timeRange);
}, [data, options, theme, timeRange]);
const { renderers, tweakScale, tweakAxis } = useMemo(() => {
@@ -212,7 +212,7 @@ export const CandlestickPanel: React.FC<CandlestickPanelProps> = ({
tweakAxis,
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [options, data.structureRev]);
}, [options, data.structureRev, data.series.length]);
if (!info) {
return (