]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Following a Slack conversation tadd new Callback to allow updates to datasets config... 2510/head
authorTarqwyn <steven@tarquindandy.com>
Tue, 10 May 2016 14:01:30 +0000 (15:01 +0100)
committerTarqwyn <steven@tarquindandy.com>
Tue, 10 May 2016 14:59:12 +0000 (15:59 +0100)
On branch feature_New_plugin_interface_afterScaleUpdate
Changes to be committed:
modified:   dist/Chart.bundle.js
modified:   dist/Chart.bundle.min.js

 #On branch feature_New_plugin_interface_afterScaleUpdate
 #Changes to be committed:

docs/07-Advanced.md
src/core/core.controller.js

index 02f8f09880763ff4a9d2fb3fb83e2e941b0671f2..3b8eacc8336b05ec2201ad4d48d9d6e8d1e01ef3 100644 (file)
@@ -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 
index 808c8b934467ad302083e37240f569dd5ad31099..aa6be982a069d5a32245c2dc95f89107f4c223e9 100644 (file)
@@ -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();