This commit is contained in:
MuslemRahimi 2024-11-27 16:29:43 +01:00
parent bbb2b42013
commit fa9e2a1726

View File

@ -506,12 +506,22 @@
const high = highList[dataIndex];
const low = lowList[dataIndex];
return `
<b>${dates[dataIndex]}</b><br>
High: ${high ? high?.toFixed(2) : "N/A"}<br>
Avg: ${mainValue?.toFixed(2)}<br>
Low: ${low ? low?.toFixed(2) : "N/A"}
`;
// Only show High and Low if they are not "N/A"
let tooltipContent = `<b>${dates[dataIndex]}</b><br>`;
if (high && high !== "N/A") {
tooltipContent += `High: ${high.toFixed(2)}<br>`;
}
if (mainValue && mainValue !== "N/A") {
tooltipContent += `Avg: ${mainValue.toFixed(2)}<br>`;
}
if (low && low !== "N/A") {
tooltipContent += `Low: ${low.toFixed(2)}<br>`;
}
return tooltipContent;
},
},
};