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

Method getBody

src/plugins/plugin.tooltip.js:554–573  ·  view source on GitHub ↗
(tooltipItems, options)

Source from the content-addressed store, hash-verified

552 }
553
554 getBody(tooltipItems, options) {
555 const {callbacks} = options;
556 const bodyItems = [];
557
558 each(tooltipItems, (context) => {
559 const bodyItem = {
560 before: [],
561 lines: [],
562 after: []
563 };
564 const scoped = overrideCallbacks(callbacks, context);
565 pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));
566 pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));
567 pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));
568
569 bodyItems.push(bodyItem);
570 });
571
572 return bodyItems;
573 }
574
575 getAfterBody(tooltipItems, options) {
576 return getBeforeAfterBodyLines(

Callers 1

updateMethod · 0.95

Calls 5

eachFunction · 0.85
overrideCallbacksFunction · 0.85
pushOrConcatFunction · 0.85
splitNewlinesFunction · 0.85

Tested by

no test coverage detected