benrubson 9 lat temu
rodzic
commit
9792bd7b08

+ 6 - 3
public/app/plugins/panel/graph/graph_tooltip.js

@@ -2,7 +2,7 @@ define([
   'jquery',
   'jquery',
   'lodash'
   'lodash'
 ],
 ],
-function ($, _) {
+function ($) {
   'use strict';
   'use strict';
 
 
   function GraphTooltip(elem, dashboard, scope, getSeriesFn) {
   function GraphTooltip(elem, dashboard, scope, getSeriesFn) {
@@ -17,7 +17,8 @@ function ($, _) {
       var initial = last*ps;
       var initial = last*ps;
       var len = series.datapoints.points.length;
       var len = series.datapoints.points.length;
       for (var j = initial; j < len; j += ps) {
       for (var j = initial; j < len; j += ps) {
-        if ((series.datapoints.points[initial] != null && series.datapoints.points[j] == null && ! series.lines.steps) || series.datapoints.points[j] > posX) {
+        if ((series.datapoints.points[initial] != null && series.datapoints.points[j] == null && ! series.lines.steps)
+            || series.datapoints.points[j] > posX) {
           return Math.max(j - ps,  0)/ps;
           return Math.max(j - ps,  0)/ps;
         }
         }
       }
       }
@@ -171,7 +172,9 @@ function ($, _) {
             continue;
             continue;
           }
           }
 
 
-          if (! distance || (hoverInfo.distance >=0 && (hoverInfo.distance < distance || distance < 0)) || (hoverInfo.distance < 0 && hoverInfo.distance > distance)) {
+          if (! distance
+              || (hoverInfo.distance >=0 && (hoverInfo.distance < distance || distance < 0))
+              || (hoverInfo.distance < 0 && hoverInfo.distance > distance)) {
             distance = hoverInfo.distance;
             distance = hoverInfo.distance;
             time = hoverInfo.time;
             time = hoverInfo.time;
           }
           }