From a756e0de15958bf3b39ee258db6d90ae7df86f77 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Mon, 12 Oct 2015 08:58:03 -0400 Subject: [PATCH] Only merge scale defaults with the global scale defaults when getting the scale defaults. Otherwise, the user does not have the ability to change them via the global settings since registration occurs when the library is loaded. --- src/core/core.scaleService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/core.scaleService.js b/src/core/core.scaleService.js index d60a4b66d..a1c1f1c20 100644 --- a/src/core/core.scaleService.js +++ b/src/core/core.scaleService.js @@ -19,13 +19,14 @@ defaults: {}, registerScaleType: function(type, scaleConstructor, defaults) { this.constructors[type] = scaleConstructor; - this.defaults[type] = helpers.scaleMerge(Chart.defaults.scale, defaults); + this.defaults[type] = helpers.clone(defaults); }, getScaleConstructor: function(type) { return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined; }, getScaleDefaults: function(type) { - return this.defaults.hasOwnProperty(type) ? this.defaults[type] : {}; + // Return the scale defaults merged with the global settings so that we always use the latest ones + return this.defaults.hasOwnProperty(type) ? helpers.scaleMerge(Chart.defaults.scale, this.defaults[type]) : {}; }, // The interesting function update: function(chartInstance, width, height) { -- 2.47.2