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

Function getAlignedX

src/plugins/plugin.tooltip.js:367–375  ·  view source on GitHub ↗
(tooltip, align, options)

Source from the content-addressed store, hash-verified

365}
366
367function getAlignedX(tooltip, align, options) {
368 const padding = toPadding(options.padding);
369
370 return align === 'center'
371 ? tooltip.x + tooltip.width / 2
372 : align === 'right'
373 ? tooltip.x + tooltip.width - padding.right
374 : tooltip.x + padding.left;
375}
376
377/**
378 * Helper to build before and after body lines

Callers 4

drawTitleMethod · 0.85
_drawColorBoxMethod · 0.85
drawBodyMethod · 0.85
drawFooterMethod · 0.85

Calls 1

toPaddingFunction · 0.85

Tested by

no test coverage detected