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

Function alignX

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

Source from the content-addressed store, hash-verified

276}
277
278function alignX(size, xAlign) {
279 let {x, width} = size;
280 if (xAlign === 'right') {
281 x -= width;
282 } else if (xAlign === 'center') {
283 x -= (width / 2);
284 }
285 return x;
286}
287
288function alignY(size, yAlign, paddingAndSize) {
289 // eslint-disable-next-line prefer-const

Callers 1

getBackgroundPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected