Skip to content

Commit

Permalink
Closes #600
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Nov 1, 2013
1 parent 14cd897 commit 90d765d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/app/panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {

var $tooltip = $('<div>');
elem.bind("plothover", function (event, pos, item) {
var group, value;
var group, value, timestamp;
if (item) {
if (item.series.info.alias || scope.panel.tooltip.query_as_alias) {
group = '<small style="font-size:0.9em;">' +
Expand All @@ -603,14 +603,15 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
} else {
group = kbn.query_color_dot(item.series.color, 15) + ' ';
}
if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') {
value = item.datapoint[1] - item.datapoint[2];
} else {
value = item.datapoint[1];
}
value = (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') ?
item.datapoint[1] - item.datapoint[2] :
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
.html(
group + value + " @ " + moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss')
group + value + " @ " + timestamp
)
.place_tt(pos.pageX, pos.pageY);
} else {
Expand Down

0 comments on commit 90d765d

Please sign in to comment.