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

Function getBoxSize

src/plugins/plugin.legend.js:24–37  ·  view source on GitHub ↗
(labelOpts, fontSize)

Source from the content-addressed store, hash-verified

22 */
23
24const getBoxSize = (labelOpts, fontSize) => {
25 let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;
26
27 if (labelOpts.usePointStyle) {
28 boxHeight = Math.min(boxHeight, fontSize);
29 boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);
30 }
31
32 return {
33 boxWidth,
34 boxHeight,
35 itemHeight: Math.max(fontSize, boxHeight)
36 };
37};
38
39const itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;
40

Callers 2

fitMethod · 0.85
_drawMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected