]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Revert unnecessary changes
authorEvert Timberg <evert.timberg+github@gmail.com>
Sat, 7 May 2016 21:04:34 +0000 (17:04 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sat, 7 May 2016 21:04:34 +0000 (17:04 -0400)
src/controllers/controller.doughnut.js
src/core/core.title.js

index 2ec30ee357954cf1a1099a9007ed125e7579871e..ba21c4506978ba1bbc4477cde1fba5f734a9a26f 100644 (file)
@@ -217,11 +217,7 @@ module.exports = function(Chart) {
                                innerRadius = reset && animationOpts.animateScale ? 0 : this.innerRadius,
                                outerRadius = reset && animationOpts.animateScale ? 0 : this.outerRadius,
                                custom = arc.custom,
-                               valueAtIndexOrDefault = helpers.getValueAtIndexOrDefault,
-                               backgroundColor = "backgroundColor",
-                               hoverBackgroundColor = "hoverBackgroundColor",
-                               borderWidth = "borderWidth",
-                               borderColor = "borderColor";
+                               valueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
 
                        helpers.extend(arc, {
                                // Utility
@@ -243,10 +239,10 @@ module.exports = function(Chart) {
                        });
 
                        var model = arc._model;
-                       model[backgroundColor] = custom && custom[backgroundColor] ? custom[backgroundColor] : valueAtIndexOrDefault(dataset[backgroundColor], index, arcOpts[backgroundColor]);
-                       model[hoverBackgroundColor] = custom && custom[hoverBackgroundColor] ? custom[hoverBackgroundColor] : valueAtIndexOrDefault(dataset[hoverBackgroundColor], index, arcOpts[hoverBackgroundColor]);
-                       model[borderWidth] = custom && custom[borderWidth] ? custom[borderWidth] : valueAtIndexOrDefault(dataset[borderWidth], index, arcOpts[borderWidth]);
-                       model[borderColor] = custom && custom[borderColor] ? custom[borderColor] : valueAtIndexOrDefault(dataset[borderColor], index, arcOpts[borderColor]);
+                       model.backgroundColor = custom && custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(dataset.backgroundColor, index, arcOpts.backgroundColor);
+                       model.hoverBackgroundColor = custom && custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, arcOpts.hoverBackgroundColor);
+                       model.borderWidth = custom && custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(dataset.borderWidth, index, arcOpts.borderWidth);
+                       model.borderColor = custom && custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(dataset.borderColor, index, arcOpts.borderColor);
 
                        // Set correct angles if not resetting
                        if (!reset || !animationOpts.animateRotate) {
index 0982986ca49118e41244e34230d11896b2c3b040..b6d82c07ed112f61fea26301f54781b53f295cc9 100644 (file)
@@ -111,20 +111,18 @@ module.exports = function(Chart) {
                                globalDefaults = Chart.defaults.global,
                                display = opts.display,
                                fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
-                               minSize = _this.minSize,
-                               width = "width",
-                               height = "height";
+                               minSize = _this.minSize;
 
                        if (_this.isHorizontal()) {
-                               minSize[width] = _this.maxWidth; // fill all the width
-                               minSize[height] = display ? fontSize + (opts.padding * 2) : 0;
+                               minSize.width = _this.maxWidth; // fill all the width
+                               minSize.height = display ? fontSize + (opts.padding * 2) : 0;
                        } else {
-                               minSize[width] = display ? fontSize + (opts.padding * 2) : 0;
-                               minSize[height] = _this.maxHeight; // fill all the height
+                               minSize.width = display ? fontSize + (opts.padding * 2) : 0;
+                               minSize.height = _this.maxHeight; // fill all the height
                        }
 
-                       _this[width] = minSize[width];
-                       _this[height] = minSize[height];
+                       _this.width = minSize.width;
+                       _this.height = minSize.height;
 
                },
                afterFit: noop,