]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
call the custom callback in tooltip options
authorTanner Linsley <tannerlinsley@gmail.com>
Sat, 31 Oct 2015 22:07:57 +0000 (16:07 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Sat, 31 Oct 2015 22:07:57 +0000 (16:07 -0600)
src/core/core.tooltip.js

index 40ec7e9d17d4f0dbc81a63fd28973d8b7cd34c46..055d68eb8e6e7d7fbe7b94dd09c504e3b88ad899 100644 (file)
                        });
                },
 
-               // Get the title 
+               // Get the title
                // Args are: (tooltipItem, data)
                getTitle: function() {
                        var beforeTitle = this._options.tooltips.callbacks.beforeTitle.apply(this, arguments),
 
                        var ctx = this._chart.ctx;
 
-                       var element = this._active[0], 
+                       var element = this._active[0],
                                labelColors = [],
                                tooltipPosition;
 
                                labelColors: labelColors,
                        });
 
+                       if (this._options.tooltips.custom) {
+                               this._options.tooltips.custom.call(this, this._model);
+                       }
+
                        return this;
                },
                draw: function() {