Skip to content

Commit

Permalink
[8.7] [ML] Fix tooltip for full-width annotations in the Single Metri…
Browse files Browse the repository at this point in the history
…c Viewer (#151179) (#151235)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[ML] Fix tooltip for full-width annotations in the Single Metric
Viewer (#151179)](#151179)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-14T23:30:42Z","message":"[ML]
Fix tooltip for full-width annotations in the Single Metric Viewer
(#151179)","sha":"19a1e14b171a61f49bcaa0b7d5584ef37584800d","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Team:ML","v8.7.0","v8.8.0"],"number":151179,"url":"https://github.com/elastic/kibana/pull/151179","mergeCommit":{"message":"[ML]
Fix tooltip for full-width annotations in the Single Metric Viewer
(#151179)","sha":"19a1e14b171a61f49bcaa0b7d5584ef37584800d"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151179","number":151179,"mergeCommit":{"message":"[ML]
Fix tooltip for full-width annotations in the Single Metric Viewer
(#151179)","sha":"19a1e14b171a61f49bcaa0b7d5584ef37584800d"}}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <[email protected]>
  • Loading branch information
kibanamachine and darnautov authored Feb 15, 2023
1 parent 6b0f1ca commit 360bc05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) =
{
name: 'preventOverflow',
options: {
rootBoundary: 'window',
rootBoundary: 'viewport',
},
},
]}
placement="right-start"
placement="top-start"
trigger="none"
tooltipShown={isTooltipShown}
tooltip={tooltipCallback}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function renderAnnotations(
rects
.attr('x', (d: Annotation) => {
const date = moment(d.timestamp);
return focusXScale(date);
return Math.max(focusXScale(date), 0);
})
.attr('y', (d: Annotation) => {
const level = d.key !== undefined ? levels[d.key] : ANNOTATION_DEFAULT_LEVEL;
Expand Down

0 comments on commit 360bc05

Please sign in to comment.