MCPcopy Create free account
hub / github.com/chartjs/Chart.js / _getXAxisLabelAlignment

Method _getXAxisLabelAlignment

src/core/core.scale.js:1336–1355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1334 }
1335
1336 _getXAxisLabelAlignment() {
1337 const {position, ticks} = this.options;
1338 const rotation = -toRadians(this.labelRotation);
1339
1340 if (rotation) {
1341 return position === 'top' ? 'left' : 'right';
1342 }
1343
1344 let align = 'center';
1345
1346 if (ticks.align === 'start') {
1347 align = 'left';
1348 } else if (ticks.align === 'end') {
1349 align = 'right';
1350 } else if (ticks.align === 'inner') {
1351 align = 'inner';
1352 }
1353
1354 return align;
1355 }
1356
1357 _getYAxisLabelAlignment(tl) {
1358 const {position, ticks: {crossAlign, mirror, padding}} = this.options;

Callers 1

_computeLabelItemsMethod · 0.95

Calls 1

toRadiansFunction · 0.85

Tested by

no test coverage detected