Skip to content

Commit

Permalink
[ML] Adds missing tooltips to Anomaly Explorer swimlane labels (#46324)…
Browse files Browse the repository at this point in the history
… (#46439)

* [ML] swimlane tooltips

* [ML] x-asis tooltip offset with laneLabelWidth
  • Loading branch information
darnautov authored Sep 24, 2019
1 parent 0b51e4a commit 8101672
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x-pack/legacy/plugins/ml/public/explorer/explorer_swimlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,15 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
.each(function () {
if (swimlaneData.fieldName !== undefined) {
d3.select(this)
.attr('tooltip-html-unsafe', label => `${mlEscape(swimlaneData.fieldName)}: ${mlEscape(label)}`)
.attr('tooltip-placement', 'right')
.on('mouseover', label => {
mlChartTooltipService.show(`${mlEscape(swimlaneData.fieldName)}: ${mlEscape(label)}`, this, {
x: laneLabelWidth,
y: 20
});
})
.on('mouseout', () => {
mlChartTooltipService.hide();
})
.attr('aria-label', label => `${mlEscape(swimlaneData.fieldName)}: ${mlEscape(label)}`);
}
});
Expand Down

0 comments on commit 8101672

Please sign in to comment.