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

Function doesNotFitWithAlign

src/plugins/plugin.tooltip.js:234–244  ·  view source on GitHub ↗
(xAlign, chart, options, size)

Source from the content-addressed store, hash-verified

232}
233
234function doesNotFitWithAlign(xAlign, chart, options, size) {
235 const {x, width} = size;
236 const caret = options.caretSize + options.caretPadding;
237 if (xAlign === 'left' && x + width + caret > chart.width) {
238 return true;
239 }
240
241 if (xAlign === 'right' && x - width - caret < 0) {
242 return true;
243 }
244}
245
246function determineXAlign(chart, options, size, yAlign) {
247 const {x, width} = size;

Callers 1

determineXAlignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected