I'm trying to customize the font color for tooltip labels in Chart.js, but I want to set different colors based on certain conditions. Specifically, I want the label color to be white by default, but change to red if a condition is met. I've looked into using the customTooltips option, but I'm open to any solution.
Here's an example of what I'm hoping to achieve:
if (difference[i] >= 0) {
tooltipFontColor: "#FFF"
} else {
tooltipFontColor: "#F00"
}
The challenge is that the difference
array contains both positive and negative values. I need Chart.js to dynamically adjust the colors based on these values.
Any insights or assistance would be greatly appreciated. Thank you!