mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
c1567ae595
commit
d1e8418c74
@ -149,8 +149,6 @@ function ($, _) {
|
|||||||
|
|
||||||
seriesHtml = '';
|
seriesHtml = '';
|
||||||
|
|
||||||
absoluteTime = dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);
|
|
||||||
|
|
||||||
// Dynamically reorder the hovercard for the current time point if the
|
// Dynamically reorder the hovercard for the current time point if the
|
||||||
// option is enabled, sort by yaxis by default.
|
// option is enabled, sort by yaxis by default.
|
||||||
if (panel.tooltip.sort === 2) {
|
if (panel.tooltip.sort === 2) {
|
||||||
@ -161,13 +159,14 @@ function ($, _) {
|
|||||||
seriesHoverInfo.sort(function(a, b) {
|
seriesHoverInfo.sort(function(a, b) {
|
||||||
return a.value - b.value;
|
return a.value - b.value;
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
seriesHoverInfo.sort(function(a, b) {
|
seriesHoverInfo.sort(function(a, b) {
|
||||||
return a.yaxis - b.yaxis;
|
return a.yaxis - b.yaxis;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var distance, time;
|
||||||
|
|
||||||
for (i = 0; i < seriesHoverInfo.length; i++) {
|
for (i = 0; i < seriesHoverInfo.length; i++) {
|
||||||
hoverInfo = seriesHoverInfo[i];
|
hoverInfo = seriesHoverInfo[i];
|
||||||
|
|
||||||
@ -175,6 +174,11 @@ function ($, _) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! distance || hoverInfo.distance < distance) {
|
||||||
|
distance = hoverInfo.distance;
|
||||||
|
time = hoverInfo.time;
|
||||||
|
}
|
||||||
|
|
||||||
var highlightClass = '';
|
var highlightClass = '';
|
||||||
if (item && i === item.seriesIndex) {
|
if (item && i === item.seriesIndex) {
|
||||||
highlightClass = 'graph-tooltip-list-item--highlight';
|
highlightClass = 'graph-tooltip-list-item--highlight';
|
||||||
@ -190,6 +194,7 @@ function ($, _) {
|
|||||||
plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);
|
plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
absoluteTime = dashboard.formatDate(time, tooltipFormat);
|
||||||
self.showTooltip(absoluteTime, seriesHtml, pos);
|
self.showTooltip(absoluteTime, seriesHtml, pos);
|
||||||
}
|
}
|
||||||
// single series tooltip
|
// single series tooltip
|
||||||
|
Loading…
Reference in New Issue
Block a user