Skip to content

Commit a93c327

Browse files
[ML] Fix layout of anomaly chart tooltip for long field values (#72689)
1 parent 47eaf60 commit a93c327

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

x-pack/plugins/ml/public/application/components/chart_tooltip/_chart_tooltip.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@
2525
}
2626

2727
&__label {
28-
overflow-wrap: break-word;
29-
word-wrap: break-word;
3028
min-width: 1px;
31-
flex: 1 1 auto;
3229
}
3330

3431
&__value {
35-
overflow-wrap: break-word;
36-
word-wrap: break-word;
3732
font-weight: $euiFontWeightBold;
3833
text-align: right;
3934
font-feature-settings: 'tnum';

x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
88
import classNames from 'classnames';
99
import TooltipTrigger from 'react-popper-tooltip';
10+
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
1011
import { TooltipValueFormatter } from '@elastic/charts';
1112

1213
import './_index.scss';
@@ -79,8 +80,17 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) =
7980
borderLeftColor: color,
8081
}}
8182
>
82-
<span className="mlChartTooltip__label">{label}</span>
83-
<span className="mlChartTooltip__value">{value}</span>
83+
<EuiFlexGroup>
84+
<EuiFlexItem
85+
className="eui-textBreakWord mlChartTooltip__label"
86+
grow={false}
87+
>
88+
{label}
89+
</EuiFlexItem>
90+
<EuiFlexItem className="eui-textBreakAll mlChartTooltip__value">
91+
{value}
92+
</EuiFlexItem>
93+
</EuiFlexGroup>
8494
</div>
8595
);
8696
})}

0 commit comments

Comments
 (0)