Skip to content

Commit 64de3eb

Browse files
committed
externalTooltips now labeled customTooltips
1 parent 8c1e958 commit 64de3eb

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

docs/00-Getting-Started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ Chart.defaults.global = {
132132
// Boolean - Determines whether to draw tooltips on the canvas or not
133133
showTooltips: true,
134134

135-
// Function - Determines whether to execute the externalTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-external-tooltips))
136-
externalTooltips: false,
135+
// Function - Determines whether to execute the customTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-custom-tooltips))
136+
customTooltips: false,
137137

138138
// Array - Array of string names to attach tooltip events
139139
tooltipEvents: ["mousemove", "touchstart", "touchmove"],

docs/06-Advanced.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ myLineChart.generateLegend();
7272

7373
### External Tooltips
7474

75-
You can enable external tooltips in the global or chart configuration like so:
75+
You can enable custom tooltips in the global or chart configuration like so:
7676

7777
```javascript
7878
var myPieChart = new Chart(ctx).Pie(data, {
79-
externalTooltips: function(tooltip) {
79+
customTooltips: function(tooltip) {
8080

8181
// tooltip will be false if tooltip is not visible or should be hidden
8282
if (!tooltip) {
@@ -100,7 +100,7 @@ var myPieChart = new Chart(ctx).Pie(data, {
100100
});
101101
```
102102

103-
See files `sample/pie-externalTooltips.html` and `sample/line-externalTooltips.html` for examples on how to get started.
103+
See files `sample/pie-customTooltips.html` and `sample/line-customTooltips.html` for examples on how to get started.
104104

105105

106106
### Writing new chart types

samples/line-externalTooltips.html renamed to samples/line-customTooltips.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<script>
5151

5252
Chart.defaults.global.pointHitDetectionRadius = 1;
53-
Chart.defaults.global.externalTooltips = function(tooltip) {
53+
Chart.defaults.global.customTooltips = function(tooltip) {
5454

5555
var tooltipEl = $('#chartjs-tooltip');
5656

samples/pie-externalTooltips.html renamed to samples/pie-customTooltips.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878

7979
<script>
80-
Chart.defaults.global.externalTooltips = function(tooltip) {
80+
Chart.defaults.global.customTooltips = function(tooltip) {
8181

8282
// Tooltip Element
8383
var tooltipEl = $('#chartjs-tooltip');

src/Chart.Core.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
showTooltips: true,
100100

101101
// Boolean - Determines whether to draw built-in tooltip or call custom tooltip function
102-
externalTooltips: false,
102+
customTooltips: false,
103103

104104
// Array - Array of string names to attach tooltip events
105105
tooltipEvents: ["mousemove", "touchstart", "touchmove", "mouseout"],
@@ -898,8 +898,8 @@
898898
this.activeElements = ChartElements;
899899
}
900900
this.draw();
901-
if(this.options.externalTooltips){
902-
this.options.externalTooltips(false);
901+
if(this.options.customTooltips){
902+
this.options.customTooltips(false);
903903
}
904904
if (ChartElements.length > 0){
905905
// If we have multiple datasets, show a MultiTooltip for all of the data points at that index
@@ -982,7 +982,7 @@
982982
title: ChartElements[0].label,
983983
chart: this.chart,
984984
ctx: this.chart.ctx,
985-
external: this.options.externalTooltips
985+
custom: this.options.customTooltips
986986
}).draw();
987987

988988
} else {
@@ -1002,7 +1002,7 @@
10021002
cornerRadius: this.options.tooltipCornerRadius,
10031003
text: template(this.options.tooltipTemplate, Element),
10041004
chart: this.chart,
1005-
external: this.options.externalTooltips
1005+
custom: this.options.customTooltips
10061006
}).draw();
10071007
}, this);
10081008
}
@@ -1281,8 +1281,8 @@
12811281
ctx.fillStyle = this.fillColor;
12821282

12831283
// Custom Tooltips
1284-
if(this.external){
1285-
this.external(this);
1284+
if(this.custom){
1285+
this.custom(this);
12861286
}
12871287
else{
12881288
switch(this.yAlign)
@@ -1381,8 +1381,8 @@
13811381
},
13821382
draw : function(){
13831383
// Custom Tooltips
1384-
if(this.external){
1385-
this.external(this);
1384+
if(this.custom){
1385+
this.custom(this);
13861386
}
13871387
else{
13881388
drawRoundedRectangle(this.ctx,this.x,this.y - this.height/2,this.width,this.height,this.cornerRadius);

0 commit comments

Comments
 (0)