]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Improved getMaxOverflow (#6874)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Mon, 30 Dec 2019 19:54:13 +0000 (13:54 -0600)
committerEvert Timberg <evert.timberg+github@gmail.com>
Mon, 30 Dec 2019 19:54:13 +0000 (14:54 -0500)
src/controllers/controller.line.js

index 5277d9cb021fb0278bdcd4d83ec741b123a22801..0e53171099a88f175235e2eb779ff617eff50f44 100644 (file)
@@ -149,11 +149,11 @@ module.exports = DatasetController.extend({
        _getMaxOverflow: function() {
                const me = this;
                const meta = me._cachedMeta;
+               const border = me._showLine && meta.dataset.options.borderWidth || 0;
                const data = meta.data || [];
                if (!data.length) {
-                       return false;
+                       return border;
                }
-               const border = me._showLine && meta.dataset.options.borderWidth || 0;
                const firstPoint = data[0].size();
                const lastPoint = data[data.length - 1].size();
                return Math.max(border, firstPoint, lastPoint) / 2;