[Chartjs]-Custom label from using separate array in Chart JS

3👍

you can storing your tooltips items in an array, and return back, it will show on the tooltips label.

for example:

callbacks: {
    label: function(tooltipItem, data) {
        var firstTooltip = "toolTipsIdx: " + tooltipItem.index;
        var otherTooltip = "Ylabel value: " + tooltipItem.yLabel;
        var tooltip = [firstTooltip, otherTooltip]; //storing all the value here
        return tooltip; //return Array back to function to show out
    }
}

Leave a comment