Chartjs-Display PHP Array in Chart.js tooltip

0👍

tooltips: {
    enabled: true,
    mode: 'single',
    callbacks: 
      {
        title: function(tooltipItem, data) 
        {
            return cpc_label[tooltipItem[0]['index']];
        },
      }
},

cpc_label is my javascript array of tooltip titles. Using this code it makes the array display each element in the respective tooltip.

Hope this solves your issue

Leave a comment