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

Method drawFooter

src/plugins/plugin.tooltip.js:993–1017  ·  view source on GitHub ↗
(pt, ctx, options)

Source from the content-addressed store, hash-verified

991 }
992
993 drawFooter(pt, ctx, options) {
994 const footer = this.footer;
995 const length = footer.length;
996 let footerFont, i;
997
998 if (length) {
999 const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
1000
1001 pt.x = getAlignedX(this, options.footerAlign, options);
1002 pt.y += options.footerMarginTop;
1003
1004 ctx.textAlign = rtlHelper.textAlign(options.footerAlign);
1005 ctx.textBaseline = 'middle';
1006
1007 footerFont = toFont(options.footerFont);
1008
1009 ctx.fillStyle = options.footerColor;
1010 ctx.font = footerFont.string;
1011
1012 for (i = 0; i < length; ++i) {
1013 ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);
1014 pt.y += footerFont.lineHeight + options.footerSpacing;
1015 }
1016 }
1017 }
1018
1019 drawBackground(pt, ctx, tooltipSize, options) {
1020 const {xAlign, yAlign} = this;

Callers 1

drawMethod · 0.95

Calls 5

getRtlAdapterFunction · 0.85
getAlignedXFunction · 0.85
toFontFunction · 0.85
textAlignMethod · 0.80
xMethod · 0.80

Tested by

no test coverage detected