Skip to content

Commit

Permalink
Fix wild special zero grid line when undefined (chartjs#4700)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
simonbrunel authored Aug 26, 2017
1 parent 68da1e3 commit 926ef0c
Show file tree
Hide file tree
Showing 33 changed files with 31 additions and 97 deletions.
2 changes: 1 addition & 1 deletion src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ module.exports = function(Chart) {

var label = tick.label;
var lineWidth, lineColor, borderDash, borderDashOffset;
if (index === (typeof me.zeroLineIndex !== 'undefined' ? me.zeroLineIndex : 0) && (options.offset === gridLines.offsetGridLines)) {
if (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {
// Draw the first index specially
lineWidth = gridLines.zeroLineWidth;
lineColor = gridLines.zeroLineColor;
Expand Down
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-boundary-end-span.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-end-span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-boundary-end.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-end.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-origin-span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-boundary-origin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-start-span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-boundary-start.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-boundary-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-dataset-span.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-dataset-span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-dataset-spline-span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-dataset-spline.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-dataset-spline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions test/fixtures/plugin.filler/fill-line-dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
}
"display": false
}],
"yAxes": [{
"ticks": {
"display": false
}
"display": false
}]
},
"elements": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-line-dataset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
"legend": false,
"title": false,
"scale": {
"pointLabels": {
"fontSize": 0
},
"ticks": {
"display": false
}
"display": false
},
"elements": {
"point": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions test/fixtures/plugin.filler/fill-radar-boundary-origin.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
"legend": false,
"title": false,
"scale": {
"pointLabels": {
"fontSize": 0
},
"ticks": {
"display": false
}
"display": false
},
"elements": {
"point": {
Expand Down
Binary file modified test/fixtures/plugin.filler/fill-radar-boundary-origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 926ef0c

Please sign in to comment.