Chartjs-Customised tooltip in chart.js

0đź‘Ť

âś…

Just replace your “callbacks” block with this one:

        callbacks: 
        {
            title: function() {
                return '';
            },
            beforeLabel: function(tooltipItem, data) {
                return 'Probability: ' + tooltipItem.xLabel + '%';
            },
            label: function(tooltipItem, data) {
                return data.datasets[tooltipItem.datasetIndex].label+': '+ tooltipItem.yLabel;
            }

        }

Leave a comment