Skip to content

Commit 60b5c74

Browse files
committed
update
1 parent 5a67cca commit 60b5c74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/core/core.scale.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras';
77
import {toFont, toPadding} from '../helpers/helpers.options';
88
import Ticks from './core.ticks';
99

10-
const reverseAling = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;
10+
const reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;
11+
const offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;
1112

1213
/**
1314
* @typedef { import("./core.controller").default } Chart
@@ -323,13 +324,11 @@ function createTickContext(parent, index, tick) {
323324
function titleAlign(align, position, reverse) {
324325
let ret = _toLeftRightCenter(align);
325326
if ((reverse && position !== 'right') || (!reverse && position === 'right')) {
326-
ret = reverseAling(ret);
327+
ret = reverseAlign(ret);
327328
}
328329
return ret;
329330
}
330331

331-
const offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;
332-
333332
function titleArgs(scale, offset, position, align) {
334333
const {top, left, bottom, right} = scale;
335334
let rotation = 0;
@@ -1691,7 +1690,7 @@ export default class Scale extends Element {
16911690
/**
16921691
* @protected
16931692
*/
1694-
drawTitle(chartArea) { // eslint-disable-line no-unused-vars
1693+
drawTitle() {
16951694
const {ctx, options: {position, title, reverse}} = this;
16961695

16971696
if (!title.display) {

0 commit comments

Comments
 (0)