From: Evert Timberg Date: Tue, 8 Dec 2015 03:10:38 +0000 (-0500) Subject: Merge branch 'v2.0-dev' into v2.0-legend X-Git-Tag: 2.0.0-beta2~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1750%2Fhead;p=thirdparty%2FChart.js.git Merge branch 'v2.0-dev' into v2.0-legend Conflicts: src/controllers/controller.doughnut.js --- 819f8657239dbdb1af0479ff6c1d99db7dbce5ef diff --cc src/controllers/controller.doughnut.js index fddc97da1,9a7cea9af..2c37b9b90 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@@ -200,16 -147,14 +200,17 @@@ }, this); }, updateElement: function(arc, index, reset) { + var centerX = (this.chart.chartArea.left + this.chart.chartArea.right) / 2; + var centerY = (this.chart.chartArea.top + this.chart.chartArea.bottom) / 2; + var resetModel = { - x: this.chart.chart.width / 2, - y: this.chart.chart.height / 2, - startAngle: Math.PI * -0.5, // use - PI / 2 instead of 3PI / 2 to make animations better. It means that we never deal with overflow during the transition function, + x: centerX, + y: centerY, + startAngle: Math.PI * -0.5, // use - PI / 2 instead of 3PI / 2 to make animations better. It means that we never deal with overflow during the transition function + endAngle: Math.PI * -0.5, circumference: (this.chart.options.animation.animateRotate) ? 0 : this.calculateCircumference(this.getDataset().data[index]), outerRadius: (this.chart.options.animation.animateScale) ? 0 : this.outerRadius, - innerRadius: (this.chart.options.animation.animateScale) ? 0 : this.innerRadius, + innerRadius: (this.chart.options.animation.animateScale) ? 0 : this.innerRadius }; helpers.extend(arc, {