[DRE-commits] [SCM] wheezy-transition-tracker.git branch, master, updated. 65ea10e2bd9c0ad81b052cbf7e0110db8faa80a3

Antonio Terceiro terceiro at softwarelivre.org
Wed Jun 15 18:36:36 UTC 2011


The following commit has been merged in the master branch:
commit 65ea10e2bd9c0ad81b052cbf7e0110db8faa80a3
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Wed Jun 15 11:34:37 2011 -0700

    Better tooltip

diff --git a/chart.js b/chart.js
index 041971d..125ef08 100644
--- a/chart.js
+++ b/chart.js
@@ -56,6 +56,7 @@ $(function() {
       }).appendTo("body").fadeIn(200);
     }
 
+    var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
     var previousPoint = null;
     $("#progress").bind("plothover", function (event, pos, item) {
       if (item) {
@@ -63,8 +64,9 @@ $(function() {
           previousPoint = item.dataIndex;
 
           $("#tooltip").remove();
-          var y = item.datapoint[1];
-          showTooltip(item.pageX, item.pageY, y)
+          var date = new Date(item.datapoint[0]);
+          var tooltip = months[date.getMonth() - 1] + ' ' + date.getDate() + ', ' + date.getFullYear() + ': <strong>' + item.datapoint[1] + '</strong>';
+          showTooltip(item.pageX, item.pageY, tooltip)
         }
       }
       else {

-- 
wheezy-transition-tracker.git



More information about the Pkg-ruby-extras-commits mailing list