Chartjs-Adding item to TooltipItems[] in ChartJS doesn't update labelColors

0๐Ÿ‘

โœ…

I was able to remediate that by creating a custom tooltip function and keeping the original one so I could access labelColor

var customTooltip = function(tooltip) {
                        if(tooltip.dataPoints != undefined){
                        var i;
                        for(i = 1; i < tooltip.dataPoints.length; i++){
                                tooltip.labelColors.push({
                                backgroundColor: tooltip.dataPoints[i].backgroundColor,
                                borderColor: tooltip.dataPoints[i].borderColor
                                });
                        }
                        }
                };

Leave a comment