Bar Chart: Crash when no number field exist (#102265)
* fix bar chart crash * format * use optional chaining
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user