From d8697ed4ef0d45b6c9d47536bb0a5b8263b1392c Mon Sep 17 00:00:00 2001 From: Kaido Hallik Date: Tue, 14 Mar 2017 23:42:45 +0200 Subject: [PATCH] use caretX instead of xCaret --- src/core/core.tooltip.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 4fa4d59cb05..f6eaf75dc9c 100755 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -331,7 +331,6 @@ module.exports = function(Chart) { function getBackgroundPoint(vm, size, alignment, chart) { // Background Position var x = vm.x; - var xCaret; var y = vm.y; var caretSize = vm.caretSize, @@ -346,7 +345,6 @@ module.exports = function(Chart) { x -= size.width; } else if (xAlign === 'center') { x -= (size.width / 2); - xCaret = x; if (x + size.width > chart.width) { x = chart.width - size.width; } @@ -377,7 +375,6 @@ module.exports = function(Chart) { return { x: x, - xCaret: xCaret, y: y }; } @@ -478,7 +475,6 @@ module.exports = function(Chart) { }; var backgroundPoint = { x: existingModel.x, - xCaret: existingModel.xCaret, y: existingModel.y }; var tooltipSize = { @@ -550,7 +546,6 @@ module.exports = function(Chart) { model.xAlign = alignment.xAlign; model.yAlign = alignment.yAlign; model.x = backgroundPoint.x; - model.xCaret = backgroundPoint.xCaret; model.y = backgroundPoint.y; model.width = tooltipSize.width; model.height = tooltipSize.height; @@ -616,11 +611,7 @@ module.exports = function(Chart) { x1 = x2 - caretSize; x3 = x2 + caretSize; } else { - if (tooltipPoint.xCaret) { - x2 = tooltipPoint.xCaret + (width / 2); - } else { - x2 = ptX + (width / 2); - } + x2 = vm.caretX; x1 = x2 - caretSize; x3 = x2 + caretSize; } @@ -798,7 +789,6 @@ module.exports = function(Chart) { }; var pt = { x: vm.x, - xCaret: vm.xCaret, y: vm.y };