]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Merge branch 'v2.0-dev' into v2.0-legend
authorEvert Timberg <evert.timberg@gmail.com>
Sat, 21 Nov 2015 14:23:33 +0000 (09:23 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Sat, 21 Nov 2015 14:23:33 +0000 (09:23 -0500)
Conflicts:
src/core/core.controller.js

1  2 
src/core/core.controller.js
src/core/core.scale.js
src/scales/scale.category.js
src/scales/scale.linear.js
test/core.layoutService.tests.js

index 18593955aa0a84d143d0e1ff98c3e8e51ae9b776,536f122ad1c78e6959122a86b2ec03f6e9ee988e..2758ef2badba3c5a3139f7e1aaa0604c7d3f8cc6
                },
  
                update: function update(animationDuration, lazy) {
 -
 -                      Chart.scaleService.update(this, this.chart.width, this.chart.height);
+                       // In case the entire data object changed
+                       this.tooltip._data = this.data;
 +                      Chart.layoutService.update(this, this.chart.width, this.chart.height);
  
                        // Make sure dataset controllers are updated and new controllers are reset
                        this.buildOrUpdateControllers(true);
Simple merge
index e3441bb20a9f81c2d5428703263fb4deb68074ef,8d8f709f0ff476d90f135f606e374b6f0bf380f4..c0fabe4070abd451fdd160091e85820e8933cd47
                      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) {
Simple merge
index 7068fb81cde2145af4b7b9b7130abac7df35c9ca,6749c0d8ae032c9187b9a7726a96f3d1e1894072..8210bc5254829d6a939b8763d7aef2e48f8cb95c
@@@ -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
  
                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