(tl)
| 1350 | } |
| 1351 | |
| 1352 | _getYAxisLabelAlignment(tl) { |
| 1353 | const {position, ticks: {crossAlign, mirror, padding}} = this.options; |
| 1354 | const labelSizes = this._getLabelSizes(); |
| 1355 | const tickAndPadding = tl + padding; |
| 1356 | const widest = labelSizes.widest.width; |
| 1357 | |
| 1358 | let textAlign; |
| 1359 | let x; |
| 1360 | |
| 1361 | if (position === 'left') { |
| 1362 | if (mirror) { |
| 1363 | x = this.right + padding; |
| 1364 | |
| 1365 | if (crossAlign === 'near') { |
| 1366 | textAlign = 'left'; |
| 1367 | } else if (crossAlign === 'center') { |
| 1368 | textAlign = 'center'; |
| 1369 | x += (widest / 2); |
| 1370 | } else { |
| 1371 | textAlign = 'right'; |
| 1372 | x += widest; |
| 1373 | } |
| 1374 | } else { |
| 1375 | x = this.right - tickAndPadding; |
| 1376 | |
| 1377 | if (crossAlign === 'near') { |
| 1378 | textAlign = 'right'; |
| 1379 | } else if (crossAlign === 'center') { |
| 1380 | textAlign = 'center'; |
| 1381 | x -= (widest / 2); |
| 1382 | } else { |
| 1383 | textAlign = 'left'; |
| 1384 | x = this.left; |
| 1385 | } |
| 1386 | } |
| 1387 | } else if (position === 'right') { |
| 1388 | if (mirror) { |
| 1389 | x = this.left + padding; |
| 1390 | |
| 1391 | if (crossAlign === 'near') { |
| 1392 | textAlign = 'right'; |
| 1393 | } else if (crossAlign === 'center') { |
| 1394 | textAlign = 'center'; |
| 1395 | x -= (widest / 2); |
| 1396 | } else { |
| 1397 | textAlign = 'left'; |
| 1398 | x -= widest; |
| 1399 | } |
| 1400 | } else { |
| 1401 | x = this.left + tickAndPadding; |
| 1402 | |
| 1403 | if (crossAlign === 'near') { |
| 1404 | textAlign = 'left'; |
| 1405 | } else if (crossAlign === 'center') { |
| 1406 | textAlign = 'center'; |
| 1407 | x += widest / 2; |
| 1408 | } else { |
| 1409 | textAlign = 'right'; |
no test coverage detected