From a3d1435a1fcae7985fe3e5784c6bdcbdd74732ab Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Fri, 26 Apr 2019 09:32:02 +0300 Subject: [PATCH] 'above' instead of 'top' --- src/core/core.scale.js | 10 +++++----- src/scales/scale.radialLinear.js | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 0f329501159..27d55831195 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -726,14 +726,14 @@ module.exports = Element.extend({ /** * Actually draw the scale on the canvas * @param {object} chartArea - the area of the chart to draw full grid lines on - * @param {boolean} top - drawing on top / after datasets + * @param {boolean} above - drawing above (after) of datasets */ - draw: function(chartArea, top) { + draw: function(chartArea, above) { var me = this; var options = me.options; var optionTicks = options.ticks; - if (!me._isVisible() || (top && optionTicks.display !== 'top')) { + if (!me._isVisible()) { return; } @@ -892,7 +892,7 @@ module.exports = Element.extend({ var glWidth = itemToDraw.glWidth; var glColor = itemToDraw.glColor; - if (gridLines.display && glWidth && glColor && !top) { + if (gridLines.display && glWidth && glColor && !above) { context.save(); context.lineWidth = glWidth; context.strokeStyle = glColor; @@ -917,7 +917,7 @@ module.exports = Element.extend({ context.restore(); } - if (optionTicks.display && (optionTicks.display === 'top') === top) { + if (optionTicks.display && (optionTicks.display === 'above') === above) { var tickFont = itemToDraw.major ? tickFonts.major : tickFonts.minor; // Make sure we draw text in the correct color and font diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index 3ae5886422d..4719ac7327f 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -476,15 +476,15 @@ module.exports = LinearScaleBase.extend({ /** * Actually draw the scale on the canvas * @param {object} chartArea - the area of the chart - * @param {boolean} top - drawing on top / after datasets + * @param {boolean} above - drawing above (after) of datasets */ - draw: function(chartArea, top) { + draw: function(chartArea, above) { var me = this; var opts = me.options; var gridLineOpts = opts.gridLines; var tickOpts = opts.ticks; - if (!opts.display || (top && tickOpts.display !== 'top')) { + if (!opts.display) { return; } @@ -492,7 +492,7 @@ module.exports = LinearScaleBase.extend({ var startAngle = this.getIndexAngle(0); var tickFont = helpers.options._parseFont(tickOpts); - if (!top && (opts.angleLines.display || opts.pointLabels.display)) { + if (!above && (opts.angleLines.display || opts.pointLabels.display)) { drawPointLabels(me); } @@ -502,7 +502,7 @@ module.exports = LinearScaleBase.extend({ var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]); // Draw circular lines around the scale - if (gridLineOpts.display && index !== 0 && !top) { + if (gridLineOpts.display && index !== 0 && !above) { drawRadiusLine(me, gridLineOpts, yCenterOffset, index); } @@ -514,8 +514,8 @@ module.exports = LinearScaleBase.extend({ ctx.translate(me.xCenter, me.yCenter); ctx.rotate(startAngle); - // Backdrop is drawn behind even if label is drawn on top - if (tickOpts.showLabelBackdrop && !top) { + // Backdrop is drawn below even if label is drawn above + if (tickOpts.showLabelBackdrop && !above) { var labelWidth = ctx.measureText(label).width; ctx.fillStyle = tickOpts.backdropColor; ctx.fillRect( @@ -526,7 +526,7 @@ module.exports = LinearScaleBase.extend({ ); } - if ((tickOpts.display === 'top') === top) { + if ((tickOpts.display === 'above') === above) { ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillStyle = tickFontColor;