]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Only merge scale defaults with the global scale defaults when getting the scale defau... 1525/head
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 12 Oct 2015 12:58:03 +0000 (08:58 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 12 Oct 2015 12:58:03 +0000 (08:58 -0400)
src/core/core.scaleService.js

index d60a4b66d40606be05d062051317776897558025..a1c1f1c207758c898d7bf5cb4213b22865c6c3db 100644 (file)
                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) {