From 92608e2dfe3771f424a78afc027ba9ef9af4434d Mon Sep 17 00:00:00 2001 From: Jake Date: Tue, 23 Jan 2018 14:04:30 -0600 Subject: [PATCH 1/2] Tick draw doesn't overlap with border or axis --- src/core/core.scale.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index ffe13cbff82..e2518514c11 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -705,10 +705,11 @@ module.exports = function(Chart) { var itemsToDraw = []; - var xTickStart = options.position === 'right' ? me.left : me.right - tl; - var xTickEnd = options.position === 'right' ? me.left + tl : me.right; - var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl; - var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom; + var axisWidth = me.options.gridLines.lineWidth; + var xTickStart = options.position === 'right' ? me.right : me.right - axisWidth - tl; + var xTickEnd = options.position === 'right' ? me.right + tl : me.right; + var yTickStart = options.position === 'bottom' ? me.top + axisWidth : me.bottom - tl - axisWidth; + var yTickEnd = options.position === 'bottom' ? me.top + axisWidth + tl : me.bottom + axisWidth; helpers.each(ticks, function(tick, index) { // autoskipper skipped this tick (#4635) @@ -764,7 +765,7 @@ module.exports = function(Chart) { ty1 = yTickStart; ty2 = yTickEnd; y1 = chartArea.top; - y2 = chartArea.bottom; + y2 = chartArea.bottom + axisWidth; } else { var isLeft = options.position === 'left'; var labelXOffset; @@ -790,7 +791,7 @@ module.exports = function(Chart) { tx1 = xTickStart; tx2 = xTickEnd; x1 = chartArea.left; - x2 = chartArea.right; + x2 = chartArea.right + axisWidth; ty1 = ty2 = y1 = y2 = yLineValue; } @@ -906,7 +907,7 @@ module.exports = function(Chart) { context.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0); context.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0); var x1 = me.left; - var x2 = me.right; + var x2 = me.right + axisWidth; var y1 = me.top; var y2 = me.bottom; From fb6849ad0022820752cc6cc5426d925784e444de Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 25 Jan 2018 23:37:55 -0600 Subject: [PATCH 2/2] Let vertical axis occupy intersection pixel --- src/core/core.scale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index e2518514c11..f79dbee8009 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -909,7 +909,7 @@ module.exports = function(Chart) { var x1 = me.left; var x2 = me.right + axisWidth; var y1 = me.top; - var y2 = me.bottom; + var y2 = me.bottom + axisWidth; var aliasPixel = helpers.aliasPixel(context.lineWidth); if (isHorizontal) {