Bar Chart: Crash when no number field exist (#102265)

* fix bar chart crash

* format

* use optional chaining
This commit is contained in:
jackyin
2025-03-22 14:44:48 -05:00
committed by GitHub
parent bb8392c9a1
commit c661077651
+1 -1
View File
@@ -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];