diff --git a/public/app/plugins/panel/barchart/utils.ts b/public/app/plugins/panel/barchart/utils.ts index 9b25e678f1f..79d9629b11b 100644 --- a/public/app/plugins/panel/barchart/utils.ts +++ b/public/app/plugins/panel/barchart/utils.ts @@ -247,7 +247,7 @@ export const prepConfig = ({ series, totalSeries, color, orientation, options, t // use opacity from first numeric field let opacityField = frame.fields.find((f) => f.type === FieldType.number)!; - fillOpacity = (opacityField.config.custom.fillOpacity ?? 100) / 100; + fillOpacity = (opacityField?.config?.custom?.fillOpacity ?? 100) / 100; getColor = (seriesIdx: number, valueIdx: number) => { let field = frame.fields[seriesIdx];