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

Method drawFooter

src/plugins/plugin.tooltip.js:935–959  ·  src/plugins/plugin.tooltip.js::Tooltip.drawFooter
(pt, ctx, options)

Source from the content-addressed store, hash-verified

933 }
934
935 drawFooter(pt, ctx, options) {
936 const footer = this.footer;
937 const length = footer.length;
938 let footerFont, i;
939
940 if (length) {
941 const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
942
943 pt.x = getAlignedX(this, options.footerAlign, options);
944 pt.y += options.footerMarginTop;
945
946 ctx.textAlign = rtlHelper.textAlign(options.footerAlign);
947 ctx.textBaseline = class="st">'middle';
948
949 footerFont = toFont(options.footerFont);
950
951 ctx.fillStyle = options.footerColor;
952 ctx.font = footerFont.string;
953
954 for (i = 0; i < length; ++i) {
955 ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);
956 pt.y += footerFont.lineHeight + options.footerSpacing;
957 }
958 }
959 }
960
961 drawBackground(pt, ctx, tooltipSize, options) {
962 const {xAlign, yAlign} = this;

Callers 1

drawMethod · 0.95

Calls 6

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

Tested by

no test coverage detected