});
}
},
+ drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {
+ var bgColor = helpers.color(vm.backgroundColor);
+ ctx.fillStyle = bgColor.alpha(opacity * bgColor.alpha()).rgbString();
+ helpers.drawRoundedRectangle(ctx, pt.x, pt.y, tooltipSize.width, tooltipSize.height, vm.cornerRadius);
+ ctx.fill();
+ },
draw: function() {
var ctx = this._chart.ctx;
var vm = this._view;
if (this._options.enabled) {
// Draw Background
- var bgColor = helpers.color(vm.backgroundColor);
- ctx.fillStyle = bgColor.alpha(opacity * bgColor.alpha()).rgbString();
- helpers.drawRoundedRectangle(ctx, pt.x, pt.y, tooltipSize.width, tooltipSize.height, vm.cornerRadius);
- ctx.fill();
+ this.drawBackground(pt, vm, ctx, tooltipSize, opacity);
// Draw Caret
this.drawCaret(pt, tooltipSize, opacity);