<canvas id="chart1" width="300" height="100" />
</div>
<script>
+ window.count = 0;
Chart.defaults.global.pointHitDetectionRadius = 1;
var customTooltips = function(tooltip) {
- console.log(tooltip);
+ console.log(window.count++, tooltip);
// Tooltip Element
var tooltipEl = $('#chartjs-tooltip');
// The usual updates
this.tooltip.initialize();
this.tooltip._active = this.tooltipActive;
+ this.tooltip.update();
}
// Hover animations
(this.lastTooltipActive.length !== this.tooltipActive.length) ||
changed) {
+ this.stop();
+
if (this.options.tooltips.enabled || this.options.tooltips.custom) {
- this.tooltip.update();
+ this.tooltip.update(true);
}
- this.stop();
// We only need to render at this point. Updating will cause scales to be recomputed generating flicker & using more
// memory than necessary.
return lines;
},
- update: function() {
+ update: function(changed) {
var ctx = this._chart.ctx;
this._model.opacity = 0;
}
- if (this._options.tooltips.custom) {
+ if (changed && this._options.tooltips.custom) {
this._options.tooltips.custom.call(this, this._model);
}
},
draw: function() {
+
var ctx = this._chart.ctx;
var vm = this._view;