Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't draw tick across axis/border #5178

Merged
merged 2 commits into from Jan 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/core/core.scale.js
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -906,9 +907,9 @@ 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;
var y2 = me.bottom + axisWidth;

var aliasPixel = helpers.aliasPixel(context.lineWidth);
if (isHorizontal) {
Expand Down