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

Function calculateItemSize

src/plugins/plugin.legend.js:555–559  ·  view source on GitHub ↗
(boxWidth, labelFont, ctx, legendItem, _itemHeight)

Source from the content-addressed store, hash-verified

553}
554
555function calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {
556 const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);
557 const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);
558 return {itemWidth, itemHeight};
559}
560
561function calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {
562 let legendItemText = legendItem.text;

Callers 1

_fitColsMethod · 0.85

Calls 2

calculateItemWidthFunction · 0.85
calculateItemHeightFunction · 0.85

Tested by

no test coverage detected