mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-13 19:56:49 +01:00
Only call custom tooltips when elements have changed. But be sure to call update internally any time that tooltips need to be redrawn.
This commit is contained in:
@@ -459,6 +459,7 @@
|
||||
// The usual updates
|
||||
this.tooltip.initialize();
|
||||
this.tooltip._active = this.tooltipActive;
|
||||
this.tooltip.update();
|
||||
}
|
||||
|
||||
// Hover animations
|
||||
@@ -484,11 +485,12 @@
|
||||
(this.lastTooltipActive.length !== this.tooltipActive.length) ||
|
||||
changed) {
|
||||
|
||||
if (this.options.tooltips.enabled || this.options.tooltips.custom) {
|
||||
this.tooltip.update();
|
||||
}
|
||||
this.stop();
|
||||
|
||||
if (this.options.tooltips.enabled || this.options.tooltips.custom) {
|
||||
this.tooltip.update(true);
|
||||
}
|
||||
|
||||
// We only need to render at this point. Updating will cause scales to be recomputed generating flicker & using more
|
||||
// memory than necessary.
|
||||
this.render(this.options.hover.animationDuration, true);
|
||||
|
||||
Reference in New Issue
Block a user