Revert unnecessary changes

This commit is contained in:
Evert Timberg 2016-05-07 17:04:34 -04:00
parent 72c791f352
commit 5141c90c7b
2 changed files with 12 additions and 18 deletions

View 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) {

View 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,