ubhatnagar 10 лет назад
Родитель
Сommit
dc4f347ae1

+ 1 - 1
public/app/panels/graph/graph.tooltip.js

@@ -117,7 +117,7 @@ function ($) {
         var seriesHoverInfo = self.getMultiSeriesPlotHoverInfo(plotData, pos);
 
         seriesHtml = '';
-        timestamp = dashboard.formatDate(seriesHoverInfo.time);
+        timestamp = dashboard.formatDate(seriesHoverInfo.time,scope.panel.tooltip.relativeTimestamp);
 
         for (i = 0; i < seriesHoverInfo.length; i++) {
           hoverInfo = seriesHoverInfo[i];

+ 4 - 0
public/app/panels/graph/styleEditor.html

@@ -52,6 +52,10 @@
 			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>