Merge pull request #1578 from prometheus/time-in-hoverdetail

Include date and time in graph hover detail.
pull/1576/head
Tobias Schmidt 9 years ago
commit 0647926817

File diff suppressed because one or more lines are too long

@ -513,9 +513,10 @@ Prometheus.Graph.prototype.updateGraph = function() {
var hoverDetail = new Rickshaw.Graph.HoverDetail({ var hoverDetail = new Rickshaw.Graph.HoverDetail({
graph: self.rickshawGraph, graph: self.rickshawGraph,
formatter: function(series, x, y) { formatter: function(series, x, y) {
var date = '<span class="date">' + new Date(x * 1000).toUTCString() + '</span>';
var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>'; var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
var content = swatch + (series.labels.__name__ || 'value') + ": <strong>" + y + '</strong><br>'; var content = swatch + (series.labels.__name__ || 'value') + ": <strong>" + y + '</strong>';
return content + self.renderLabels(series.labels); return date + '<br>' + content + '<br>' + self.renderLabels(series.labels);
} }
}); });

Loading…
Cancel
Save