MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / formatRowHtml

Function formatRowHtml

src/components/formatTooltip.ts:76–90  ·  view source on GitHub ↗
(params: TooltipParams, valueText: string)

Source from the content-addressed store, hash-verified

74}
75
76function formatRowHtml(params: TooltipParams, valueText: string): string {
77 const safeName = escapeHtml(resolveSeriesName(params));
78 const safeValue = escapeHtml(valueText);
79 const safeColor = escapeHtml(sanitizeCssColor(params.color));
80
81 return [
82 '<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;">',
83 '<span style="display:flex;align-items:center;gap:8px;min-width:0;">',
84 `<span style="width:8px;height:8px;border-radius:999px;flex:0 0 auto;background-color:${safeColor};"></span>`,
85 `<span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${safeName}</span>`,
86 '</span>',
87 `<span style="font-variant-numeric:tabular-nums;white-space:nowrap;">${safeValue}</span>`,
88 '</div>',
89 ].join('');
90}
91
92function formatCandlestickRowHtml(params: TooltipParams): string {
93 const [, open, close, low, high] = params.value as readonly [number, number, number, number, number];

Callers 2

formatTooltipItemFunction · 0.85
formatTooltipAxisFunction · 0.85

Calls 3

resolveSeriesNameFunction · 0.85
sanitizeCssColorFunction · 0.85
escapeHtmlFunction · 0.70

Tested by

no test coverage detected