]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix wild special zero grid line when undefined (#4700)
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sat, 26 Aug 2017 05:48:57 +0000 (07:48 +0200)
committerGitHub <noreply@github.com>
Sat, 26 Aug 2017 05:48:57 +0000 (07:48 +0200)
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.

33 files changed:
src/core/core.scale.js
test/fixtures/plugin.filler/fill-line-boundary-end-span.json
test/fixtures/plugin.filler/fill-line-boundary-end-span.png
test/fixtures/plugin.filler/fill-line-boundary-end.json
test/fixtures/plugin.filler/fill-line-boundary-end.png
test/fixtures/plugin.filler/fill-line-boundary-origin-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-span.png
test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.png
test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json
test/fixtures/plugin.filler/fill-line-boundary-origin-spline.png
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.png
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.png
test/fixtures/plugin.filler/fill-line-boundary-origin.json
test/fixtures/plugin.filler/fill-line-boundary-origin.png
test/fixtures/plugin.filler/fill-line-boundary-start-span.json
test/fixtures/plugin.filler/fill-line-boundary-start-span.png
test/fixtures/plugin.filler/fill-line-boundary-start.json
test/fixtures/plugin.filler/fill-line-boundary-start.png
test/fixtures/plugin.filler/fill-line-dataset-span.json
test/fixtures/plugin.filler/fill-line-dataset-span.png
test/fixtures/plugin.filler/fill-line-dataset-spline-span.json
test/fixtures/plugin.filler/fill-line-dataset-spline-span.png
test/fixtures/plugin.filler/fill-line-dataset-spline.json
test/fixtures/plugin.filler/fill-line-dataset-spline.png
test/fixtures/plugin.filler/fill-line-dataset.json
test/fixtures/plugin.filler/fill-line-dataset.png
test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json
test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.png
test/fixtures/plugin.filler/fill-radar-boundary-origin.json
test/fixtures/plugin.filler/fill-radar-boundary-origin.png

index 6f63b92dbd7e8b782e1a022de4eb7d3e26471cb4..bc4d1ec9c7bdbef9105c5e1a289139e1e621eab8 100644 (file)
@@ -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;
index 3c151a14ffd8a38c9f6179ab8f2cbf1209dd289a..d197b40626472c6bf3f92e66b9a588c22f48cdae 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 83519b05fb72b9c23a2d305937c0c6a2201fef3c..0939727d078ba46e0e9c73eeef486ed3ab96cd26 100644 (file)
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
index 297fe6e25e697c6ff937fadac4b8c0ef71b8a744..4c99b445bb0db7641d60ffb749fb8218087b0b64 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 25c8f13699684a835fab695d023ca3b8a6a29e67..fb3011b42091bb7847fd3b098e8bb65372c71297 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-boundary-end.png and b/test/fixtures/plugin.filler/fill-line-boundary-end.png differ
index 8a09d635e98e94afe91585583ece14da2aa760c8..391bc98d80ad05fb1efd4df21fb3c349cf3b6a1b 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 727cc0309b0f2baa70c52218ba2975ed790f4547..24ccc2490dabede2f3a52d6b234078765df340d7 100644 (file)
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
index f433aa444b5c04d9fa5be28830a69997340b9109..709df7649417a73eb820a52e17bf8d6a40686d31 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 01aae5a995d0dfe10b4fee9e0feacb2f9f1894e6..75aef6a768fd640ffe2bd0d314313fbc6059c09d 100644 (file)
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
index a714b7e500b100a54c4acf0155289c684c59e4fb..05adc36253ccaea1a7e2f9ca101e0885c98f8ced 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index b2ec1797ff5d4d576980e28f745bd2f049ea90b9..3e22492e5083bd415d49f318d287057b2a8e8ac9 100644 (file)
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
index bd1abc29efccb5529ee42fa51b3ad0d0f404de7a..79ee41aa0b9b6c9e3e86ca42a08e9a953541b02b 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 9f7c15b9ddbc5e8e5dffe34cd1b48780a190e813..524a8fb387f4342eeadf383cf7595e653288993b 100644 (file)
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
index 95203904d1f0f933e6ec7bd8017e719ee6b964dd..6e5eafed299ae0a44edfeb6f109b23ad60f3c859 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 19f5a8d92620793d9df4a07f9e8a280b64ae9a20..60de6ba21a36be7a5ca5a988b0705d90ead0eb65 100644 (file)
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
index 094653639471491ef545272265077ae313cf7444..5aa0bf289fd817bd7d2951d861233ab2792d2aa9 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index f8f0208d4fde7f1f79a312e59ff3f3d5af6ae163..29df37b8731222aeda1a8549c845f3b43bc7e50a 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-boundary-origin.png and b/test/fixtures/plugin.filler/fill-line-boundary-origin.png differ
index de1022da744fda24fd97130399d0c5712fdbf33f..970e928045addf1d6d4654016ad480984ab8fa4b 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 45e4992768b07b190bc8ebf7b2fb3ced93d7343b..8100ad07d756366ab0c79b81d8697741aac63ba6 100644 (file)
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
index 893db5c171df576524cdd48af25bd6d97e818cd8..fccd681bf012c28bfe41c5c16fd5eddd6e324f91 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 1cd05e60dfc521ba99969a0a973c8b32e39b2806..da20bdcdea5189f8ad6a5f9635427b9dbbcef0bd 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-boundary-start.png and b/test/fixtures/plugin.filler/fill-line-boundary-start.png differ
index 34b4ddc7f5947174af605d9df8d110d467c6f751..e1b159c01a2fa939a7cfaba507ab833068e86914 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index a6de728589e16a85fbf1115e3e807779cef35e0d..7c8a856c678aece91d3b24e4aaefcfa7fdc88b70 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-dataset-span.png and b/test/fixtures/plugin.filler/fill-line-dataset-span.png differ
index a37ce02a90203a1f739829bf03a3f85263efb688..5635b6c91989fce82c1cefbc6b0ebc7845383240 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 7fb4e403e4c30435e61755ad3121c701e52689cb..5f66359f3b57decaba1c133c1cd2de1be17d08bf 100644 (file)
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
index 329e7123c097df9b0397aba3cf5f9fb17d7d43b3..fbddcc3a5a0502d5e0871d835336afdd63ab9e89 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index 41d52bc77db885b5333bd79545deabc8a0356c85..8147e4d8073d5fa8b45f1107ad52f5532a61516f 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-dataset-spline.png and b/test/fixtures/plugin.filler/fill-line-dataset-spline.png differ
index 4224b78bcfc7fd30ba126cfd11b90e289c7d99cd..dcf118cdee7a0156e7757ba2a32d3f5f9d9c9d46 100644 (file)
             "title": false,
             "scales": {
                 "xAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }],
                 "yAxes": [{
-                    "ticks": {
-                        "display": false
-                    }
+                    "display": false
                 }]
             },
             "elements": {
index d8a7e09d3b7881bf1f7fe8620fa904f594182397..88f9d4fd8559efaa1eb8761e6f9f0892f7e8a874 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-line-dataset.png and b/test/fixtures/plugin.filler/fill-line-dataset.png differ
index 8640adcf89ccfe881a0e1a16d577d40e33aad82d..e5c4b2f800927f793a48a177e16def1a2659a727 100644 (file)
             "legend": false,
             "title": false,
             "scale": {
-                "pointLabels": {
-                    "fontSize": 0
-                },
-                "ticks": {
-                    "display": false
-                }
+                "display": false
             },
             "elements": {
                 "point": {
index 29b6c8e185ecd19a9626affda59b0ac318088905..74124a3e7f26734e987839c3c202748eb137620d 100644 (file)
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
index fafe29791aff43ad04cc3bcd142be54e8b53e9ce..0cc32b4a93aaaf6d6bcfa37f396b00c51e98c624 100644 (file)
             "legend": false,
             "title": false,
             "scale": {
-                "pointLabels": {
-                    "fontSize": 0
-                },
-                "ticks": {
-                    "display": false
-                }
+                "display": false
             },
             "elements": {
                 "point": {
index 5ede186f2c660d67067b3107b3b7b15a1e9c9059..2c07f7f0b2c2bd996ed549ee512779905de26883 100644 (file)
Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-origin.png and b/test/fixtures/plugin.filler/fill-radar-boundary-origin.png differ