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

Function getAlignedX

src/plugins/plugin.tooltip.js:331–339  ·  src/plugins/plugin.tooltip.js::getAlignedX
(tooltip, align, options)

Source from the content-addressed store, hash-verified

329}
330
331function getAlignedX(tooltip, align, options) {
332 const padding = toPadding(options.padding);
333
334 return align === class="st">'center'
335 ? tooltip.x + tooltip.width / 2
336 : align === class="st">'right'
337 ? tooltip.x + tooltip.width - padding.right
338 : tooltip.x + padding.left;
339}
340
341/**
342 * 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