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

Function determineAlignment

src/plugins/plugin.tooltip.js:305–312  ·  view source on GitHub ↗

* Helper to get the alignment of a tooltip given the size

(chart, options, size)

Source from the content-addressed store, hash-verified

303 * Helper to get the alignment of a tooltip given the size
304 */
305function determineAlignment(chart, options, size) {
306 const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);
307
308 return {
309 xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),
310 yAlign
311 };
312}
313
314function alignX(size, xAlign) {
315 let {x, width} = size;

Callers 2

updateMethod · 0.85

Calls 2

determineYAlignFunction · 0.85
determineXAlignFunction · 0.85

Tested by

no test coverage detected