From: Evert Timberg Date: Sat, 21 Nov 2015 14:23:33 +0000 (-0500) Subject: Merge branch 'v2.0-dev' into v2.0-legend X-Git-Tag: 2.0.0-beta2~25^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9b3e52217ac21a743f23ebace266962ac6c844;p=thirdparty%2FChart.js.git Merge branch 'v2.0-dev' into v2.0-legend Conflicts: src/core/core.controller.js --- 2a9b3e52217ac21a743f23ebace266962ac6c844 diff --cc src/core/core.controller.js index 18593955a,536f122ad..2758ef2ba --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@@ -219,7 -207,10 +227,9 @@@ }, update: function update(animationDuration, lazy) { + // In case the entire data object changed + this.tooltip._data = this.data; - - Chart.scaleService.update(this, this.chart.width, this.chart.height); + Chart.layoutService.update(this, this.chart.width, this.chart.height); // Make sure dataset controllers are updated and new controllers are reset this.buildOrUpdateControllers(true); diff --cc src/scales/scale.category.js index e3441bb20,8d8f709f0..c0fabe407 --- a/src/scales/scale.category.js +++ b/src/scales/scale.category.js @@@ -30,10 -30,10 +30,10 @@@ widthOffset += (valueWidth / 2); } - return this.left + Math.round(widthOffset); + return this.left + this.margins.left + Math.round(widthOffset); } else { var innerHeight = this.height - (this.paddingTop + this.paddingBottom); - var valueHeight = innerHeight / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1); + var valueHeight = innerHeight / Math.max((this.chart.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1); var heightOffset = (valueHeight * index) + this.paddingTop; if (this.options.gridLines.offsetGridLines && includeOffset) { diff --cc test/core.layoutService.tests.js index 7068fb81c,6749c0d8a..8210bc525 --- a/test/core.layoutService.tests.js +++ b/test/core.layoutService.tests.js @@@ -39,13 -43,13 +43,13 @@@ describe('Test the layout service', fun var canvasWidth = 250; var canvasHeight = 150; - Chart.scaleService.update(chartInstance, canvasWidth, canvasHeight); + Chart.layoutService.update(chartInstance, canvasWidth, canvasHeight); expect(chartInstance.chartArea).toEqual({ - left: 45, + left: 55, right: 245, top: 5, - bottom: 76.0423977855504, + bottom: 75.0664716027288, }); // Is xScale at the right spot @@@ -176,13 -190,13 +190,13 @@@ var canvasWidth = 250; var canvasHeight = 150; - Chart.scaleService.update(chartInstance, canvasWidth, canvasHeight); + Chart.layoutService.update(chartInstance, canvasWidth, canvasHeight); expect(chartInstance.chartArea).toEqual({ - left: 95, + left: 115, right: 245, top: 5, - bottom: 70.01536896070459, + bottom: 68.48521368620018, }); // Is xScale at the right spot