Skip to content

Commit 5a014dc

Browse files
authored
Fix wild special zero grid line when undefined (#4700)
Remove the special drawing for an undefined zero grid line since it causes issue when the first tick is not aligned on the scale extremity (ie only linear scales now display a special grid line for the origin). Hide scales in the filler plugin unit test fixtures to avoid future failures due to changes unrelated to the tested features.
1 parent 488cbbc commit 5a014dc

33 files changed

+31
-97
lines changed

src/core/core.scale.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ module.exports = function(Chart) {
680680

681681
var label = tick.label;
682682
var lineWidth, lineColor, borderDash, borderDashOffset;
683-
if (index === (typeof me.zeroLineIndex !== 'undefined' ? me.zeroLineIndex : 0) && (options.offset === gridLines.offsetGridLines)) {
683+
if (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {
684684
// Draw the first index specially
685685
lineWidth = gridLines.zeroLineWidth;
686686
lineColor = gridLines.zeroLineColor;

test/fixtures/plugin.filler/fill-line-boundary-end-span.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
"title": false,
2525
"scales": {
2626
"xAxes": [{
27-
"ticks": {
28-
"display": false
29-
}
27+
"display": false
3028
}],
3129
"yAxes": [{
32-
"ticks": {
33-
"display": false
34-
}
30+
"display": false
3531
}]
3632
},
3733
"elements": {
166 Bytes
Loading

test/fixtures/plugin.filler/fill-line-boundary-end.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
"title": false,
2525
"scales": {
2626
"xAxes": [{
27-
"ticks": {
28-
"display": false
29-
}
27+
"display": false
3028
}],
3129
"yAxes": [{
32-
"ticks": {
33-
"display": false
34-
}
30+
"display": false
3531
}]
3632
},
3733
"elements": {
663 Bytes
Loading

test/fixtures/plugin.filler/fill-line-boundary-origin-span.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
"title": false,
2525
"scales": {
2626
"xAxes": [{
27-
"ticks": {
28-
"display": false
29-
}
27+
"display": false
3028
}],
3129
"yAxes": [{
32-
"ticks": {
33-
"display": false
34-
}
30+
"display": false
3531
}]
3632
},
3733
"elements": {
1.12 KB
Loading

test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
"title": false,
2525
"scales": {
2626
"xAxes": [{
27-
"ticks": {
28-
"display": false
29-
}
27+
"display": false
3028
}],
3129
"yAxes": [{
32-
"ticks": {
33-
"display": false
34-
}
30+
"display": false
3531
}]
3632
},
3733
"elements": {
288 Bytes
Loading

test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
"title": false,
2525
"scales": {
2626
"xAxes": [{
27-
"ticks": {
28-
"display": false
29-
}
27+
"display": false
3028
}],
3129
"yAxes": [{
32-
"ticks": {
33-
"display": false
34-
}
30+
"display": false
3531
}]
3632
},
3733
"elements": {

0 commit comments

Comments
 (0)