You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `mode` | `String` | `'nearest'` | Sets which elements appear in the tooltip. [more...](../general/interactions/modes.md#interaction-modes).
12
12
| `intersect` | `Boolean` | `true` | if true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times.
@@ -191,6 +191,9 @@ var myPieChart = new Chart(ctx, {
191
191
data: data,
192
192
options: {
193
193
tooltips: {
194
+
// Disable the on-canvas tooltip
195
+
enabled:false,
196
+
194
197
custom:function(tooltipModel) {
195
198
// Tooltip Element
196
199
var tooltipEl =document.getElementById('chartjs-tooltip');
@@ -199,7 +202,7 @@ var myPieChart = new Chart(ctx, {
199
202
if (!tooltipEl) {
200
203
tooltipEl =document.createElement('div');
201
204
tooltipEl.id='chartjs-tooltip';
202
-
tooltipEl.innerHTML="<table></table>"
205
+
tooltipEl.innerHTML="<table></table>";
203
206
document.body.appendChild(tooltipEl);
204
207
}
205
208
@@ -238,7 +241,7 @@ var myPieChart = new Chart(ctx, {
238
241
var style ='background:'+colors.backgroundColor;
239
242
style +='; border-color:'+colors.borderColor;
240
243
style +='; border-width: 2px';
241
-
var span ='<span class="chartjs-tooltip-key" style="'+ style +'"></span>';
244
+
var span ='<span style="'+ style +'"></span>';
242
245
innerHtml +='<tr><td>'+ span + body +'</td></tr>';
243
246
});
244
247
innerHtml +='</tbody>';
@@ -252,19 +255,20 @@ var myPieChart = new Chart(ctx, {
0 commit comments