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
});
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) {
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,