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