Skip to content

Commit e488c08

Browse files
[ML] fix tooltip content for scheduled events (#75973)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent a358c57 commit e488c08

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) =
7272
// eslint-disable-next-line @typescript-eslint/naming-convention
7373
echTooltip__rowHighlighted: isHighlighted,
7474
});
75+
76+
const renderValue = Array.isArray(value)
77+
? value.map((v) => <div key={v}>{v}</div>)
78+
: value;
79+
7580
return (
7681
<div
7782
key={`${seriesIdentifier.key}__${valueAccessor}`}
@@ -88,7 +93,7 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) =
8893
{label}
8994
</EuiFlexItem>
9095
<EuiFlexItem className="eui-textBreakAll mlChartTooltip__value">
91-
{value}
96+
{renderValue}
9297
</EuiFlexItem>
9398
</EuiFlexGroup>
9499
</div>

x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
} from '../../util/chart_utils';
3838
import { LoadingIndicator } from '../../components/loading_indicator/loading_indicator';
3939
import { getTimeBucketsFromCache } from '../../util/time_buckets';
40-
import { mlEscape } from '../../util/string_utils';
4140
import { mlFieldFormatService } from '../../services/field_format_service';
4241

4342
const CONTENT_WRAPPER_HEIGHT = 215;
@@ -486,7 +485,7 @@ export class ExplorerChartSingleMetric extends React.Component {
486485
label: i18n.translate('xpack.ml.explorer.singleMetricChart.scheduledEventsLabel', {
487486
defaultMessage: 'Scheduled events',
488487
}),
489-
value: marker.scheduledEvents.map(mlEscape).join('<br/>'),
488+
value: marker.scheduledEvents,
490489
seriesIdentifier: {
491490
key: seriesKey,
492491
},

0 commit comments

Comments
 (0)