]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix axis line width when option is an array (#5751)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sun, 18 Nov 2018 08:45:41 +0000 (03:45 -0500)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Sun, 18 Nov 2018 08:45:41 +0000 (09:45 +0100)
When the axis lineWidth setting is set to an array, use the first item when determining the size of the axis area.

src/core/core.scale.js

index f08c68fe9182a6e1450e14dc513a56d934cb71de..28211b7f43a5aaef7f0fc70809d95a6861fb9020 100644 (file)
@@ -708,7 +708,7 @@ module.exports = Element.extend({
 
                var itemsToDraw = [];
 
-               var axisWidth = me.options.gridLines.lineWidth;
+               var axisWidth = helpers.valueAtIndexOrDefault(me.options.gridLines.lineWidth, 0);
                var xTickStart = options.position === 'right' ? me.left : me.right - axisWidth - tl;
                var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
                var yTickStart = options.position === 'bottom' ? me.top + axisWidth : me.bottom - tl - axisWidth;