Skip to content

Commit

Permalink
[Custom threshold] Fix the custom equation label on the preview lens …
Browse files Browse the repository at this point in the history
…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](https://github.com/user-attachments/assets/b4f1a1e7-8e67-4b24-ae48-379fe393f90a)|![image](https://github.com/user-attachments/assets/3ef2733f-9ce8-4b37-8ecf-c19c1371aced)|![image](https://github.com/user-attachments/assets/d638f49e-98e2-4df7-8852-84dc62b9f739)|

(cherry picked from commit 8668757)
  • Loading branch information
maryam-saeidi committed Nov 12, 2024
1 parent ee0934b commit a81cf12
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface RuleConditionChartExpressions {
timeSize?: number;
timeUnit?: TimeUnitChar;
equation?: string;
label?: string;
}
export interface RuleConditionChartProps {
metricExpression: RuleConditionChartExpressions;
Expand Down Expand Up @@ -108,6 +109,7 @@ export function RuleConditionChart({
threshold,
comparator,
equation,
label,
warningComparator,
warningThreshold,
} = metricExpression;
Expand Down Expand Up @@ -332,7 +334,7 @@ export function RuleConditionChart({
const baseLayer = {
type: 'formula',
value: formula,
label: formula,
label: label ?? formula,
groupBy,
format: {
id: formatId,
Expand Down Expand Up @@ -409,6 +411,7 @@ export function RuleConditionChart({
comparator,
dataView,
equation,
label,
searchConfiguration,
formula,
formulaAsync.value,
Expand Down

0 comments on commit a81cf12

Please sign in to comment.