From 04e86c05ca630363b906902eaa0dbe1fbbbe82d6 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 25 Jan 2018 23:17:24 -0600 Subject: [PATCH] Add offset to axis length instead of padding to chart area --- src/core/core.scale.js | 3 --- src/scales/scale.category.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index ffe13cbff82..c632d60d023 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -459,9 +459,6 @@ module.exports = function(Chart) { if (me.labelRotation !== 0) { me.paddingLeft = opts.position === 'bottom' ? (cosRotation * firstLabelWidth) + 3 : (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges me.paddingRight = opts.position === 'bottom' ? (cosRotation * lineSpace) + 3 : (cosRotation * lastLabelWidth) + 3; - } else { - me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges - me.paddingRight = lastLabelWidth / 2 + 3; } } else { // A vertical axis is more constrained by the width. Labels are the diff --git a/src/scales/scale.category.js b/src/scales/scale.category.js index 5910ce88a51..edd7e33dab5 100644 --- a/src/scales/scale.category.js +++ b/src/scales/scale.category.js @@ -80,7 +80,7 @@ module.exports = function(Chart) { } if (me.isHorizontal()) { - var valueWidth = me.width / offsetAmt; + var valueWidth = (me.width - 5) / offsetAmt; var widthOffset = (valueWidth * (index - me.minIndex)); if (offset) {