mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-05 16:04:03 +01:00
Merge pull request #2508 from Tarqwyn/feature_New_plugin_interface_afterScaleUpdate
Added new plugin Callback `afterScaleUpdate`
This commit is contained in:
13823
dist/Chart.bundle.js
vendored
13823
dist/Chart.bundle.js
vendored
File diff suppressed because it is too large
Load Diff
16
dist/Chart.bundle.min.js
vendored
16
dist/Chart.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
9784
dist/Chart.js
vendored
9784
dist/Chart.js
vendored
File diff suppressed because it is too large
Load Diff
15
dist/Chart.min.js
vendored
15
dist/Chart.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -377,6 +377,7 @@ Plugins will be called at the following times
|
||||
* Start of initialization
|
||||
* End of initialization
|
||||
* Start of update
|
||||
* After the chart scales have calculated
|
||||
* End of update (before render occurs)
|
||||
* Start of draw
|
||||
* End of draw
|
||||
@@ -389,6 +390,7 @@ Plugins should derive from Chart.PluginBase and implement the following interfac
|
||||
afterInit: function(chartInstance) { },
|
||||
|
||||
beforeUpdate: function(chartInstance) { },
|
||||
afterScaleUpdate: function(chartInstance) { },
|
||||
afterUpdate: function(chartInstance) { },
|
||||
|
||||
// This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw
|
||||
|
||||
@@ -257,6 +257,9 @@ module.exports = function(Chart) {
|
||||
|
||||
Chart.layoutService.update(this, this.chart.width, this.chart.height);
|
||||
|
||||
// Apply changes to the dataets that require the scales to have been calculated i.e BorderColor chages
|
||||
Chart.pluginService.notifyPlugins('afterScaleUpdate', [this]);
|
||||
|
||||
// Can only reset the new controllers after the scales have been updated
|
||||
helpers.each(newControllers, function(controller) {
|
||||
controller.reset();
|
||||
|
||||
Reference in New Issue
Block a user