Skip to content

Commit 0342442

Browse files
committed
Merge pull request grafana#4493 from mtanda/highlight_tooltip
highlight series name in tooltip when shared tooltip enabled
2 parents 5d9c3d5 + 0a13b7c commit 0342442

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

public/app/plugins/panel/graph/graph_tooltip.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,16 @@ function ($) {
142142
continue;
143143
}
144144

145+
var highlightStyle = '';
146+
if (item && i === item.seriesIndex) {
147+
highlightStyle = ' style="font-weight: bold;"';
148+
}
149+
145150
series = seriesList[i];
146151

147152
value = series.formatValue(hoverInfo.value);
148153

149-
seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
154+
seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name"' + highlightStyle + '>';
150155
seriesHtml += '<i class="fa fa-minus" style="color:' + series.color +';"></i> ' + series.label + ':</div>';
151156
seriesHtml += '<div class="graph-tooltip-value">' + value + '</div></div>';
152157
plot.highlight(i, hoverInfo.hoverIndex);

0 commit comments

Comments
 (0)