]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
chart.bar - remove tooltip on mouseout
authorTanner Linsley <tannerlinsley@gmail.com>
Sat, 13 Jun 2015 06:45:43 +0000 (00:45 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Sat, 13 Jun 2015 06:45:43 +0000 (00:45 -0600)
src/charts/chart.bar.js

index 0cc3030a5dddd5055d8aff0d5adae3eba5ae07bb..358a5fe016a59b1022a54a0dd8a3735367fee377 100644 (file)
         events: function(e) {
 
 
-            // If exiting chart
-            if (e.type == 'mouseout') {
-                return this;
-            }
 
             this.lastActive = this.lastActive || [];
 
             // Find Active Elements
-            this.active = function() {
-                switch (this.options.hover.mode) {
-                    case 'single':
-                        return this.getElementAtEvent(e);
-                    case 'label':
-                        return this.getElementsAtEvent(e);
-                    case 'dataset':
-                        return this.getDatasetAtEvent(e);
-                    default:
-                        return e;
-                }
-            }.call(this);
+            if (e.type == 'mouseout') {
+                this.active = [];
+            } else {
+                this.active = function() {
+                    switch (this.options.hover.mode) {
+                        case 'single':
+                            return this.getElementAtEvent(e);
+                        case 'label':
+                            return this.getElementsAtEvent(e);
+                        case 'dataset':
+                            return this.getDatasetAtEvent(e);
+                        default:
+                            return e;
+                    }
+                }.call(this);
+            }
 
             // On Hover hook
             if (this.options.hover.onHover) {