helpers.extend(Chart.Controller.prototype, {
initialize: function initialize() {
-
- // TODO
- // If BeforeInit(this) doesn't return false, proceed
+ // Before init plugin notification
+ Chart.pluginService.notifyPlugins('beforeInit', this);
this.bindEvents();
this.initToolTip();
this.update();
- // TODO
- // If AfterInit(this) doesn't return false, proceed
+ // After init plugin notification
+ Chart.pluginService.notifyPlugins('afterInit', this);
return this;
},
},
update: function update(animationDuration, lazy) {
+ Chart.pluginService.notifyPlugins('beforeUpdate', this);
+
// In case the entire data object changed
this.tooltip._data = this.data;
dataset.controller.update();
});
this.render(animationDuration, lazy);
+
+ Chart.pluginService.notifyPlugins('afterUpdate', this);
},
render: function render(duration, lazy) {
var easingDecimal = ease || 1;
this.clear();
+ Chart.pluginService.notifyPlugins('beforeDraw', this);
+
// Draw all the scales
helpers.each(this.boxes, function(box) {
box.draw(this.chartArea);
// Finally draw the tooltip
this.tooltip.transition(easingDecimal).draw();
+
+ Chart.pluginService.notifyPlugins('afterDraw', this);
},
// Get the single element that was clicked on