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

Function formatTooltipAxis

src/components/formatTooltip.ts:159–177  ·  view source on GitHub ↗
(params: TooltipParams[])

Source from the content-addressed store, hash-verified

157 * Candlestick series show O/H/L/C values with arrow and percentage change.
158 */
159export function formatTooltipAxis(params: TooltipParams[]): string {
160 if (params.length === 0) return '';
161
162 const xText = `x: ${formatNumber(params[0].value[0])}`;
163 const header = `<div style="margin:0 0 6px 0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;">${escapeHtml(
164 xText,
165 )}</div>`;
166
167 const rows = params
168 .map((p) => {
169 if (isCandlestickValue(p.value)) {
170 return formatCandlestickRowHtml(p);
171 }
172 return formatRowHtml(p, formatNumber(p.value[1]));
173 })
174 .join('<div style="height:4px;"></div>');
175
176 return `${header}${rows}`;
177}
178

Callers 1

renderFunction · 0.90

Calls 5

isCandlestickValueFunction · 0.85
formatCandlestickRowHtmlFunction · 0.85
formatRowHtmlFunction · 0.85
formatNumberFunction · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected