Skip to content

Commit

Permalink
'above' instead of 'top'
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Apr 26, 2019
1 parent f53c872 commit a3d1435
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/core/core.scale.js
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/scales/scale.radialLinear.js
Expand Up @@ -476,23 +476,23 @@ 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;
}

var ctx = me.ctx;
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);
}

Expand All @@ -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);
}

Expand All @@ -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(
Expand All @@ -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;
Expand Down

0 comments on commit a3d1435

Please sign in to comment.