MCPcopy
hub / github.com/chartjs/Chart.js / _getXAxisLabelAlignment

Method _getXAxisLabelAlignment

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

Source from the content-addressed store, hash-verified

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

Callers 1

_computeLabelItemsMethod · 0.95

Calls 1

toRadiansFunction · 0.85

Tested by

no test coverage detected