mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Make the afterUpdate plugin method more useful
This commit is contained in:
parent
c276926c14
commit
23722a8b25
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user