Commit e0b58577 by utkarshcmu

Added relative time by default, removed checkbox

parent af65a81d
......@@ -226,7 +226,7 @@ function (angular, $, kbn, _, moment) {
moment.utc(date).format(format);
};
p.formatRelativeDate = function(date) {
p.getRelativeTime = function(date) {
date = this.checkDate(date);
......
......@@ -32,12 +32,7 @@ function ($) {
};
this.showTooltip = function(absoluteTime, relativeTime, innerHtml, pos) {
var body;
if(typeof relativeTime === 'undefined') {
body = '<div class="graph-tooltip small"><div class="graph-tooltip-time">'+ absoluteTime + '</div> ' ;
} else {
body = '<div class="graph-tooltip small"><div class="graph-tooltip-time">'+ absoluteTime + '<br>(' + relativeTime + ')</div> ' ;
}
var body = '<div class="graph-tooltip small"><div class="graph-tooltip-time">'+ absoluteTime + '<br>(' + relativeTime + ')</div> ' ;
body += innerHtml + '</div>';
$tooltip.html(body).place_tt(pos.pageX + 20, pos.pageY);
};
......@@ -123,10 +118,7 @@ function ($) {
seriesHtml = '';
if(scope.panel.tooltip.relativeTimestamp) {
relativeTime = dashboard.formatRelativeDate(seriesHoverInfo.time);
}
relativeTime = dashboard.getRelativeTime(seriesHoverInfo.time);
absoluteTime = dashboard.formatDate(seriesHoverInfo.time);
for (i = 0; i < seriesHoverInfo.length; i++) {
......@@ -163,15 +155,12 @@ function ($) {
value = series.formatValue(value);
if(scope.panel.tooltip.relativeTimestamp) {
relativeTime = dashboard.formatRelativeDate(item.datapoint[0]);
}
relativeTime = dashboard.getRelativeTime(item.datapoint[0]);
absoluteTime = dashboard.formatDate(item.datapoint[0]);
group += '<div class="graph-tooltip-value">' + value + '</div>';
self.showTooltipOther(absoluteTime, relativeTime, group, pos);
self.showTooltip(absoluteTime, relativeTime, group, pos);
}
// no hit
else {
......
......@@ -52,10 +52,6 @@
text="All series" model="panel.tooltip.shared" change="render()"
tip="Show all series on same tooltip and a x croshair to help follow all series">
</editor-opt-bool>
<editor-opt-bool
text="Relative timestamp" model="panel.tooltip.relativeTimestamp" change="render()"
tip="Shows elapsed time in relatively from the current timestamp. For example, 45 mins ago, 1 day 2 hours ago, etc.">
</editor-opt-bool>
<div class="editor-option" ng-show="panel.stack">
<label class="small">Stacked Values <tip>How should the values in stacked charts to be calculated?</tip></label>
<select class="input-small" ng-model="panel.tooltip.value_type" ng-options="f for f in ['cumulative','individual']" ng-change="render()"></select>
......
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