[Chartjs]-Customizing tooltip on chart.js bar chart

11👍

Chart.js moved from Templates to Object interfaces in v2+, so for instance If you just want to modify the tooltip text…

tooltips: {
    callbacks: {
        label: function(tooltipItem) {
            return "$" + Number(tooltipItem.yLabel) + " and so worth it !";
        }
    }
}

Result:

enter image description here

Codepen: Chart.js Custom Tooltip

For more complex tooltip customizations see their samples on github: tooltips

Leave a comment