]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
externalTooltips now labeled customTooltips 840/head
authorTanner Linsley <tannerlinsley@gmail.com>
Wed, 7 Jan 2015 05:53:30 +0000 (22:53 -0700)
committerTanner Linsley <tannerlinsley@gmail.com>
Wed, 7 Jan 2015 05:53:30 +0000 (22:53 -0700)
docs/00-Getting-Started.md
docs/06-Advanced.md
samples/line-customTooltips.html [moved from samples/line-externalTooltips.html with 98% similarity]
samples/pie-customTooltips.html [moved from samples/pie-externalTooltips.html with 98% similarity]
src/Chart.Core.js

index 7cb1097aa7c049bb53644b6e2ff499014144ab30..8690197aff62f8ec1ca677e2ef6c77e27b61bfad 100644 (file)
@@ -132,8 +132,8 @@ Chart.defaults.global = {
        // Boolean - Determines whether to draw tooltips on the canvas or not
        showTooltips: true,
 
-       // Function - Determines whether to execute the externalTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-external-tooltips))
-       externalTooltips: false,
+       // Function - Determines whether to execute the customTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-custom-tooltips))
+       customTooltips: false,
 
        // Array - Array of string names to attach tooltip events
        tooltipEvents: ["mousemove", "touchstart", "touchmove"],
index d6cbf3a031df0b06c69e5caf7cfffa2dd3b3b557..9911bedb4da7446bce1c15d3a93140e0590ba5d1 100644 (file)
@@ -72,11 +72,11 @@ myLineChart.generateLegend();
 
 ### External Tooltips
 
-You can enable external tooltips in the global or chart configuration like so:
+You can enable custom tooltips in the global or chart configuration like so:
 
 ```javascript
 var myPieChart = new Chart(ctx).Pie(data, {
-       externalTooltips: function(tooltip) {
+       customTooltips: function(tooltip) {
 
         // tooltip will be false if tooltip is not visible or should be hidden
         if (!tooltip) {
@@ -100,7 +100,7 @@ var myPieChart = new Chart(ctx).Pie(data, {
 });
 ```
 
-See files `sample/pie-externalTooltips.html` and `sample/line-externalTooltips.html` for examples on how to get started.
+See files `sample/pie-customTooltips.html` and `sample/line-customTooltips.html` for examples on how to get started.
 
 
 ### Writing new chart types
similarity index 98%
rename from samples/line-externalTooltips.html
rename to samples/line-customTooltips.html
index 67eab85eedc6ac4fb3ed5455a175015de7cbc7e1..4dc46e1abca038869a77a779777b702b03c9affc 100644 (file)
@@ -50,7 +50,7 @@
     <script>
 
     Chart.defaults.global.pointHitDetectionRadius = 1;
-    Chart.defaults.global.externalTooltips = function(tooltip) {
+    Chart.defaults.global.customTooltips = function(tooltip) {
 
         var tooltipEl = $('#chartjs-tooltip');
 
similarity index 98%
rename from samples/pie-externalTooltips.html
rename to samples/pie-customTooltips.html
index c126c640fc4881559b02212693841ece9857360c..732317de464398d4daf99ce623d460f0d1349696 100644 (file)
@@ -77,7 +77,7 @@
 
 
     <script>
-    Chart.defaults.global.externalTooltips = function(tooltip) {
+    Chart.defaults.global.customTooltips = function(tooltip) {
 
        // Tooltip Element
         var tooltipEl = $('#chartjs-tooltip');
index 07c63c4d5a27634141d544d90093c5f26162cae3..845f01967fccddecbde7a0fd3ecb3114fa78216b 100755 (executable)
@@ -99,7 +99,7 @@
                        showTooltips: true,
 
                        // Boolean - Determines whether to draw built-in tooltip or call custom tooltip function
-                       externalTooltips: false,
+                       customTooltips: false,
 
                        // Array - Array of string names to attach tooltip events
                        tooltipEvents: ["mousemove", "touchstart", "touchmove", "mouseout"],
                                this.activeElements = ChartElements;
                        }
                        this.draw();
-                       if(this.options.externalTooltips){
-                               this.options.externalTooltips(false);
+                       if(this.options.customTooltips){
+                               this.options.customTooltips(false);
                        }
                        if (ChartElements.length > 0){
                                // If we have multiple datasets, show a MultiTooltip for all of the data points at that index
                                                title: ChartElements[0].label,
                                                chart: this.chart,
                                                ctx: this.chart.ctx,
-                                               external: this.options.externalTooltips
+                                               custom: this.options.customTooltips
                                        }).draw();
 
                                } else {
                                                        cornerRadius: this.options.tooltipCornerRadius,
                                                        text: template(this.options.tooltipTemplate, Element),
                                                        chart: this.chart,
-                                                       external: this.options.externalTooltips
+                                                       custom: this.options.customTooltips
                                                }).draw();
                                        }, this);
                                }
                        ctx.fillStyle = this.fillColor;
 
                        // Custom Tooltips
-                       if(this.external){
-                               this.external(this);
+                       if(this.custom){
+                               this.custom(this);
                        }
                        else{
                                switch(this.yAlign)
                },
                draw : function(){
                        // Custom Tooltips
-                       if(this.external){
-                               this.external(this);
+                       if(this.custom){
+                               this.custom(this);
                        }
                        else{
                                drawRoundedRectangle(this.ctx,this.x,this.y - this.height/2,this.width,this.height,this.cornerRadius);