Commit 90d765d9 by Rashid Khan

Closes #600

parent 14cd8975
...@@ -593,7 +593,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -593,7 +593,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
var $tooltip = $('<div>'); var $tooltip = $('<div>');
elem.bind("plothover", function (event, pos, item) { elem.bind("plothover", function (event, pos, item) {
var group, value; var group, value, timestamp;
if (item) { if (item) {
if (item.series.info.alias || scope.panel.tooltip.query_as_alias) { if (item.series.info.alias || scope.panel.tooltip.query_as_alias) {
group = '<small style="font-size:0.9em;">' + group = '<small style="font-size:0.9em;">' +
...@@ -603,14 +603,15 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -603,14 +603,15 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
} else { } else {
group = kbn.query_color_dot(item.series.color, 15) + ' '; group = kbn.query_color_dot(item.series.color, 15) + ' ';
} }
if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') { value = (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') ?
value = item.datapoint[1] - item.datapoint[2]; item.datapoint[1] - item.datapoint[2] :
} else { item.datapoint[1];
value = item.datapoint[1]; timestamp = scope.panel.timezone === 'browser' ?
} moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') :
moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss');
$tooltip $tooltip
.html( .html(
group + value + " @ " + moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') group + value + " @ " + timestamp
) )
.place_tt(pos.pageX, pos.pageY); .place_tt(pos.pageX, pos.pageY);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment