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

Function determineYAlign

src/plugins/plugin.tooltip.js:259–268  ·  view source on GitHub ↗
(chart, size)

Source from the content-addressed store, hash-verified

257}
258
259function determineYAlign(chart, size) {
260 const {y, height} = size;
261
262 if (y < height / 2) {
263 return 'top';
264 } else if (y > (chart.height - height / 2)) {
265 return 'bottom';
266 }
267 return 'center';
268}
269
270function doesNotFitWithAlign(xAlign, chart, options, size) {
271 const {x, width} = size;

Callers 1

determineAlignmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected