Browse Source

Restored some previous grafana modifications to jquery flot

Torkel Ödegaard 10 years ago
parent
commit
5aa495d0e4
1 changed files with 5 additions and 3 deletions
  1. 5 3
      public/vendor/jquery/jquery.flot.js

+ 5 - 3
public/vendor/jquery/jquery.flot.js

@@ -371,7 +371,7 @@ Licensed under the MIT license.
 
 
       info = styleCache[text] = { element: element, positions: [] };
       info = styleCache[text] = { element: element, positions: [] };
 
 
-      var size = null;// this._textSizeCache[text];
+      var size = this._textSizeCache[text];
 			if (size) {
 			if (size) {
         info.width = size.width;
         info.width = size.width;
         info.height = size.height;
         info.height = size.height;
@@ -380,7 +380,6 @@ Licensed under the MIT license.
         info.height = element.outerHeight(true);
         info.height = element.outerHeight(true);
         this._textSizeCache[text] = { width: info.width, height: info.height };
         this._textSizeCache[text] = { width: info.width, height: info.height };
 			}
 			}
-
 			element.detach();
 			element.detach();
 		}
 		}
 
 
@@ -1422,7 +1421,8 @@ Licensed under the MIT license.
 
 
                 var info = surface.getTextInfo(layer, t.label, font, null, maxWidth);
                 var info = surface.getTextInfo(layer, t.label, font, null, maxWidth);
 
 
-                labelWidth = Math.max(labelWidth, info.width);
+                /// Grafana fix, add +1 to label width
+                labelWidth = Math.max(labelWidth, info.width + 1);
                 labelHeight = Math.max(labelHeight, info.height);
                 labelHeight = Math.max(labelHeight, info.height);
             }
             }
 
 
@@ -1734,6 +1734,8 @@ Licensed under the MIT license.
             axis.delta = delta;
             axis.delta = delta;
             axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
             axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
             axis.tickSize = opts.tickSize || size;
             axis.tickSize = opts.tickSize || size;
+            // grafana addition
+            axis.scaledDecimals = axis.tickDecimals - Math.floor(Math.log(axis.tickSize) / Math.LN10);
 
 
             // Time mode was moved to a plug-in in 0.8, and since so many people use it
             // Time mode was moved to a plug-in in 0.8, and since so many people use it
             // we'll add an especially friendly reminder to make sure they included it.
             // we'll add an especially friendly reminder to make sure they included it.