Skip to content

Commit

Permalink
Add offset to axis length instead of padding to chart area
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake committed Jan 26, 2018
1 parent 274fca6 commit 04e86c0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/scales/scale.category.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 04e86c0

Please sign in to comment.