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

Function doesNotFitWithAlign

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

Source from the content-addressed store, hash-verified

268}
269
270function doesNotFitWithAlign(xAlign, chart, options, size) {
271 const {x, width} = size;
272 const caret = options.caretSize + options.caretPadding;
273 if (xAlign === 'left' && x + width + caret > chart.width) {
274 return true;
275 }
276
277 if (xAlign === 'right' && x - width - caret < 0) {
278 return true;
279 }
280}
281
282function determineXAlign(chart, options, size, yAlign) {
283 const {x, width} = size;

Callers 1

determineXAlignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected