mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
Don't draw tick across axis/border (#5178)
This commit is contained in:
parent
98ef3942d9
commit
e61392a256
@ -705,10 +705,11 @@ module.exports = function(Chart) {
|
|||||||
|
|
||||||
var itemsToDraw = [];
|
var itemsToDraw = [];
|
||||||
|
|
||||||
var xTickStart = options.position === 'right' ? me.left : me.right - tl;
|
var axisWidth = me.options.gridLines.lineWidth;
|
||||||
var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
|
var xTickStart = options.position === 'right' ? me.right : me.right - axisWidth - tl;
|
||||||
var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;
|
var xTickEnd = options.position === 'right' ? me.right + tl : me.right;
|
||||||
var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;
|
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) {
|
helpers.each(ticks, function(tick, index) {
|
||||||
// autoskipper skipped this tick (#4635)
|
// autoskipper skipped this tick (#4635)
|
||||||
@ -764,7 +765,7 @@ module.exports = function(Chart) {
|
|||||||
ty1 = yTickStart;
|
ty1 = yTickStart;
|
||||||
ty2 = yTickEnd;
|
ty2 = yTickEnd;
|
||||||
y1 = chartArea.top;
|
y1 = chartArea.top;
|
||||||
y2 = chartArea.bottom;
|
y2 = chartArea.bottom + axisWidth;
|
||||||
} else {
|
} else {
|
||||||
var isLeft = options.position === 'left';
|
var isLeft = options.position === 'left';
|
||||||
var labelXOffset;
|
var labelXOffset;
|
||||||
@ -790,7 +791,7 @@ module.exports = function(Chart) {
|
|||||||
tx1 = xTickStart;
|
tx1 = xTickStart;
|
||||||
tx2 = xTickEnd;
|
tx2 = xTickEnd;
|
||||||
x1 = chartArea.left;
|
x1 = chartArea.left;
|
||||||
x2 = chartArea.right;
|
x2 = chartArea.right + axisWidth;
|
||||||
ty1 = ty2 = y1 = y2 = yLineValue;
|
ty1 = ty2 = y1 = y2 = yLineValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,9 +907,9 @@ module.exports = function(Chart) {
|
|||||||
context.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0);
|
context.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0);
|
||||||
context.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0);
|
context.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0);
|
||||||
var x1 = me.left;
|
var x1 = me.left;
|
||||||
var x2 = me.right;
|
var x2 = me.right + axisWidth;
|
||||||
var y1 = me.top;
|
var y1 = me.top;
|
||||||
var y2 = me.bottom;
|
var y2 = me.bottom + axisWidth;
|
||||||
|
|
||||||
var aliasPixel = helpers.aliasPixel(context.lineWidth);
|
var aliasPixel = helpers.aliasPixel(context.lineWidth);
|
||||||
if (isHorizontal) {
|
if (isHorizontal) {
|
||||||
|
Loading…
Reference in New Issue
Block a user