[Chartjs]-How to use HTML in custom tooltip in angular charts?

4👍

You should use an array for “simulate” new line:

tooltips: {
    //mode: "label",
    callbacks: {
        label: function(tooltipItem, data) {
            var legend = new Array();
            for(var i in data.datasets){
                legend.push(
                    data.datasets[i].label + ": " + parseFloat(data.datasets[i].data[tooltipItem.index])
                );
            }

            return legend;
        }
    }
},

Leave a comment