Skip to content

Commit 31b3cfc

Browse files
Aggregation widget axis labels improvements (#24408)
1 parent 44b7184 commit 31b3cfc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graylog2-web-interface/src/views/components/visualizations/xyAxisConfigFields.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const getNumericAxisMetrics = (values: WidgetConfigFormValues) => {
3030
const metrics = values?.metrics ?? [];
3131

3232
return metrics
33-
.filter(({ field }) => !(units?.[field]?.unitType && units?.[field]?.abbrev))
33+
.filter(({ field, function: metricFn }) => !(units?.[field]?.unitType && units?.[field]?.abbrev) && metricFn)
3434
.map((metric) => metric.name || `${metric.function}(${metric.field ?? ''})`);
3535
};
3636

@@ -45,8 +45,8 @@ export const getAxisMetrics = (unitType: FieldUnitType, values: WidgetConfigForm
4545
);
4646

4747
return metrics
48-
.filter(({ field }) => unitTypeFields.has(field))
49-
.map((metric) => metric.name ?? `${metric.function}(${metric.field ?? ''})`);
48+
.filter(({ field, function: metricFn }) => unitTypeFields.has(field) && metricFn)
49+
.map((metric) => metric.name || `${metric.function}(${metric.field ?? ''})`);
5050
};
5151

5252
const getUnitTypeFields = (): Array<CustomField> =>

0 commit comments

Comments
 (0)