Skip to content

Commit c5568c4

Browse files
fix usechartlegendregistration hook: error when additionalNames is undefined
1 parent 783b056 commit c5568c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ui/src/hooks/useChartLegendRegistration.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ export const useChartLegendRegistration = ({
5353
}
5454
}
5555

56-
if (seriesNames.length > 0) {
57-
const allSeriesNames = [...seriesNames, ...additionalNames];
58-
register(chartId, allSeriesNames);
56+
if (additionalNames) {
57+
seriesNames.push(...additionalNames);
5958
}
59+
60+
register(chartId, seriesNames);
6061
}, [chartId, register, series, isSymmetrical, additionalNames]);
6162
};

0 commit comments

Comments
 (0)