[Custom threshold] Fix the custom equation label on the preview lens chart (#199618)

Fixes #181876

## Summary

This PR fixes the custom equation label on the preview lens chart.

|With label|Without label|With group by field|
|---|---|---|

|![image](d638f49e-98e2-4df7-8852-84dc62b9f739)|
This commit is contained in:
Maryam Saeidi 2024-11-12 13:01:36 +01:00 committed by GitHub
parent 13ae98602f
commit 8668757459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,7 @@ export interface RuleConditionChartExpressions {
timeSize?: number;
timeUnit?: TimeUnitChar;
equation?: string;
label?: string;
}
export interface RuleConditionChartProps {
metricExpression: RuleConditionChartExpressions;
@ -108,6 +109,7 @@ export function RuleConditionChart({
threshold,
comparator,
equation,
label,
warningComparator,
warningThreshold,
} = metricExpression;
@ -332,7 +334,7 @@ export function RuleConditionChart({
const baseLayer = {
type: 'formula',
value: formula,
label: formula,
label: label ?? formula,
groupBy,
format: {
id: formatId,
@ -409,6 +411,7 @@ export function RuleConditionChart({
comparator,
dataView,
equation,
label,
searchConfiguration,
formula,
formulaAsync.value,