BarChart: Fix type error when there are no series (#89087)
BarChart: Fix reference error when there are no series
This commit is contained in:
@@ -92,7 +92,7 @@ export const BarChartPanel = (props: PanelProps<Options>) => {
|
||||
|
||||
const xGroupsCount = vizSeries[0]?.length ?? 0;
|
||||
const seriesCount = vizSeries[0]?.fields.length ?? 0;
|
||||
const totalSeries = info.series[0].fields.length - 1;
|
||||
const totalSeries = Math.max(0, (info.series[0]?.fields.length ?? 0) - 1);
|
||||
|
||||
let { builder, prepData } = useMemo(
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user