initialize: function initialize() {
// Before init plugin notification
- Chart.pluginService.notifyPlugins('beforeInit', this);
+ Chart.pluginService.notifyPlugins('beforeInit', [this]);
this.bindEvents();
this.update();
// After init plugin notification
- Chart.pluginService.notifyPlugins('afterInit', this);
+ Chart.pluginService.notifyPlugins('afterInit', [this]);
return this;
},
},
update: function update(animationDuration, lazy) {
- Chart.pluginService.notifyPlugins('beforeUpdate', this);
+ Chart.pluginService.notifyPlugins('beforeUpdate', [this]);
// In case the entire data object changed
this.tooltip._data = this.data;
});
this.render(animationDuration, lazy);
- Chart.pluginService.notifyPlugins('afterUpdate', this);
+ Chart.pluginService.notifyPlugins('afterUpdate', [this]);
},
render: function render(duration, lazy) {
var easingDecimal = ease || 1;
this.clear();
- Chart.pluginService.notifyPlugins('beforeDraw', this);
+ Chart.pluginService.notifyPlugins('beforeDraw', [this, easingDecimal]);
// Draw all the scales
helpers.each(this.boxes, function(box) {
// Finally draw the tooltip
this.tooltip.transition(easingDecimal).draw();
- Chart.pluginService.notifyPlugins('afterDraw', this);
+ Chart.pluginService.notifyPlugins('afterDraw', [this, easingDecimal]);
},
// Get the single element that was clicked on
},
// Iterate over all plugins
- notifyPlugins: function(method, chartInstance, scope) {
+ notifyPlugins: function(method, args, scope) {
helpers.each(Chart.plugins, function(plugin) {
if (plugin[method] && typeof plugin[method] === 'function') {
- plugin[method].call(scope, chartInstance);
+ plugin[method].apply(scope, args);
}
}, scope);
}