Make the afterUpdate plugin method more useful

This commit is contained in:
Evert Timberg 2016-05-09 18:14:15 -04:00 committed by Tanner Linsley
parent c276926c14
commit 23722a8b25
2 changed files with 5 additions and 3 deletions

View File

@ -377,9 +377,10 @@ Plugins will be called at the following times
* Start of initialization
* End of initialization
* Start of update
* End of update
* End of update (before render occurs)
* Start of draw
* End of draw
* Before an animation is started
Plugins should derive from Chart.PluginBase and implement the following interface
```javascript

View File

@ -267,9 +267,10 @@ module.exports = function(Chart) {
this.getDatasetMeta(datasetIndex).controller.update();
}, this);
this.render(animationDuration, lazy);
// Do this before render so that any plugins that need final scale updates can use it
Chart.pluginService.notifyPlugins('afterUpdate', [this]);
this.render(animationDuration, lazy);
},
render: function render(duration, lazy) {