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

Method _getXAxisLabelAlignment

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

Source from the content-addressed store, hash-verified

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

Callers 1

_computeLabelItemsMethod · 0.95

Calls 1

toRadiansFunction · 0.85

Tested by

no test coverage detected