From: Simon Brunel Date: Sat, 26 Aug 2017 05:48:57 +0000 (+0200) Subject: Fix wild special zero grid line when undefined (#4700) X-Git-Tag: v2.7.0~1^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a014dc36190107146ebf4f7c29bc2cfb40c36ec;p=thirdparty%2FChart.js.git 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. --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 6f63b92db..bc4d1ec9c 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -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; diff --git a/test/fixtures/plugin.filler/fill-line-boundary-end-span.json b/test/fixtures/plugin.filler/fill-line-boundary-end-span.json index 3c151a14f..d197b4062 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-end-span.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-end-span.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-end-span.png b/test/fixtures/plugin.filler/fill-line-boundary-end-span.png index 83519b05f..0939727d0 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-end-span.png and b/test/fixtures/plugin.filler/fill-line-boundary-end-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-end.json b/test/fixtures/plugin.filler/fill-line-boundary-end.json index 297fe6e25..4c99b445b 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-end.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-end.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-end.png b/test/fixtures/plugin.filler/fill-line-boundary-end.png index 25c8f1369..fb3011b42 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-end.png and b/test/fixtures/plugin.filler/fill-line-boundary-end.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-span.json b/test/fixtures/plugin.filler/fill-line-boundary-origin-span.json index 8a09d635e..391bc98d8 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin-span.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin-span.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-span.png b/test/fixtures/plugin.filler/fill-line-boundary-origin-span.png index 727cc0309..24ccc2490 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin-span.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json index f433aa444..709df7649 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.png b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.png index 01aae5a99..75aef6a76 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json index a714b7e50..05adc3625 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png index b2ec1797f..3e22492e5 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json index bd1abc29e..79ee41aa0 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.png b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.png index 9f7c15b9d..524a8fb38 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json index 95203904d..6e5eafed2 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.png b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.png index 19f5a8d92..60de6ba21 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin.json b/test/fixtures/plugin.filler/fill-line-boundary-origin.json index 094653639..5aa0bf289 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-origin.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-origin.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-origin.png b/test/fixtures/plugin.filler/fill-line-boundary-origin.png index f8f0208d4..29df37b87 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-start-span.json b/test/fixtures/plugin.filler/fill-line-boundary-start-span.json index de1022da7..970e92804 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-start-span.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-start-span.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-start-span.png b/test/fixtures/plugin.filler/fill-line-boundary-start-span.png index 45e499276..8100ad07d 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-start-span.png and b/test/fixtures/plugin.filler/fill-line-boundary-start-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-boundary-start.json b/test/fixtures/plugin.filler/fill-line-boundary-start.json index 893db5c17..fccd681bf 100644 --- a/test/fixtures/plugin.filler/fill-line-boundary-start.json +++ b/test/fixtures/plugin.filler/fill-line-boundary-start.json @@ -24,14 +24,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-boundary-start.png b/test/fixtures/plugin.filler/fill-line-boundary-start.png index 1cd05e60d..da20bdcde 100644 Binary files a/test/fixtures/plugin.filler/fill-line-boundary-start.png and b/test/fixtures/plugin.filler/fill-line-boundary-start.png differ diff --git a/test/fixtures/plugin.filler/fill-line-dataset-span.json b/test/fixtures/plugin.filler/fill-line-dataset-span.json index 34b4ddc7f..e1b159c01 100644 --- a/test/fixtures/plugin.filler/fill-line-dataset-span.json +++ b/test/fixtures/plugin.filler/fill-line-dataset-span.json @@ -32,14 +32,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-dataset-span.png b/test/fixtures/plugin.filler/fill-line-dataset-span.png index a6de72858..7c8a856c6 100644 Binary files a/test/fixtures/plugin.filler/fill-line-dataset-span.png and b/test/fixtures/plugin.filler/fill-line-dataset-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-dataset-spline-span.json b/test/fixtures/plugin.filler/fill-line-dataset-spline-span.json index a37ce02a9..5635b6c91 100644 --- a/test/fixtures/plugin.filler/fill-line-dataset-spline-span.json +++ b/test/fixtures/plugin.filler/fill-line-dataset-spline-span.json @@ -32,14 +32,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-dataset-spline-span.png b/test/fixtures/plugin.filler/fill-line-dataset-spline-span.png index 7fb4e403e..5f66359f3 100644 Binary files a/test/fixtures/plugin.filler/fill-line-dataset-spline-span.png and b/test/fixtures/plugin.filler/fill-line-dataset-spline-span.png differ diff --git a/test/fixtures/plugin.filler/fill-line-dataset-spline.json b/test/fixtures/plugin.filler/fill-line-dataset-spline.json index 329e7123c..fbddcc3a5 100644 --- a/test/fixtures/plugin.filler/fill-line-dataset-spline.json +++ b/test/fixtures/plugin.filler/fill-line-dataset-spline.json @@ -32,14 +32,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-dataset-spline.png b/test/fixtures/plugin.filler/fill-line-dataset-spline.png index 41d52bc77..8147e4d80 100644 Binary files a/test/fixtures/plugin.filler/fill-line-dataset-spline.png and b/test/fixtures/plugin.filler/fill-line-dataset-spline.png differ diff --git a/test/fixtures/plugin.filler/fill-line-dataset.json b/test/fixtures/plugin.filler/fill-line-dataset.json index 4224b78bc..dcf118cde 100644 --- a/test/fixtures/plugin.filler/fill-line-dataset.json +++ b/test/fixtures/plugin.filler/fill-line-dataset.json @@ -32,14 +32,10 @@ "title": false, "scales": { "xAxes": [{ - "ticks": { - "display": false - } + "display": false }], "yAxes": [{ - "ticks": { - "display": false - } + "display": false }] }, "elements": { diff --git a/test/fixtures/plugin.filler/fill-line-dataset.png b/test/fixtures/plugin.filler/fill-line-dataset.png index d8a7e09d3..88f9d4fd8 100644 Binary files a/test/fixtures/plugin.filler/fill-line-dataset.png and b/test/fixtures/plugin.filler/fill-line-dataset.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json index 8640adcf8..e5c4b2f80 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json @@ -22,12 +22,7 @@ "legend": false, "title": false, "scale": { - "pointLabels": { - "fontSize": 0 - }, - "ticks": { - "display": false - } + "display": false }, "elements": { "point": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.png b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.png index 29b6c8e18..74124a3e7 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.png and b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin.json index fafe29791..0cc32b4a9 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-origin.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin.json @@ -22,12 +22,7 @@ "legend": false, "title": false, "scale": { - "pointLabels": { - "fontSize": 0 - }, - "ticks": { - "display": false - } + "display": false }, "elements": { "point": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin.png b/test/fixtures/plugin.filler/fill-radar-boundary-origin.png index 5ede186f2..2c07f7f0b 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-origin.png and b/test/fixtures/plugin.filler/fill-radar-boundary-origin.png differ