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

Function alignX

src/plugins/plugin.tooltip.js:314–322  ·  view source on GitHub ↗
(size, xAlign)

Source from the content-addressed store, hash-verified

312}
313
314function alignX(size, xAlign) {
315 let {x, width} = size;
316 if (xAlign === 'right') {
317 x -= width;
318 } else if (xAlign === 'center') {
319 x -= (width / 2);
320 }
321 return x;
322}
323
324function alignY(size, yAlign, paddingAndSize) {
325 // eslint-disable-next-line prefer-const

Callers 1

getBackgroundPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected