]> granicus.if.org Git - pgbadger/commitdiff
Add trackFormatter to flotr2 line graphs to show current x/y values
authorDarold Gilles <gilles@darold.net>
Tue, 10 Jul 2012 14:56:51 +0000 (16:56 +0200)
committerDarold Gilles <gilles@darold.net>
Tue, 10 Jul 2012 14:56:51 +0000 (16:56 +0200)
pgbadger

index e4e725bf0638796d2018d66093fe886ebd91395b..0877ff8ea077b4817267a0c4c4b0285c5c41d550 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -3056,6 +3056,11 @@ document.writeln('<table align="center"><tr><td><input type="button" class="dldB
             position: "nw",
             backgroundColor: "#D2E8FF"
         },
+       mouse: {
+            track: true,
+           trackFormatter: function(obj){ return dateTracker(obj) },
+            relative: true
+        },
         HtmlText: false,
     };
 
@@ -3205,6 +3210,12 @@ EOF
 __DATA__
 
 <script type="text/javascript">
+function dateTracker(obj) 
+{
+       var dateToDisplay = new Date(parseInt(obj.x)); 
+       return '('+dateToDisplay.toGMTString()+' , '+obj.y+')';
+}
+
 /*!
   * bean.js - copyright Jacob Thornton 2011
   * https://github.com/fat/bean