mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Include date and time in graph hover detail.
This is the same solution as applied to PromDash in https://github.com/prometheus/promdash/pull/72. Fixes https://github.com/prometheus/prometheus/issues/1569
This commit is contained in:
parent
bf0897bea5
commit
c78bd13a2b
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({
|
||||
graph: self.rickshawGraph,
|
||||
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 content = swatch + (series.labels.__name__ || 'value') + ": <strong>" + y + '</strong><br>';
|
||||
return content + self.renderLabels(series.labels);
|
||||
var content = swatch + (series.labels.__name__ || 'value') + ": <strong>" + y + '</strong>';
|
||||
return date + '<br>' + content + '<br>' + self.renderLabels(series.labels);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue