mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 08:24:05 +01:00
Added new plugin Callback afterScaleUpdate
Following a Slack conversation tadd new Callback to allow updates to datasets config (ie borderColor) based on results of the calculated scale, A typical use case would be apply a Gradient fill. On branch feature_New_plugin_interface_afterScaleUpdate Changes to be committed: modified: dist/Chart.bundle.js modified: dist/Chart.bundle.min.js
This commit is contained in:
@@ -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