[Chartjs]-Chart.js add label into tooltip

0👍

Should be like this to work properly and if you want to include all data for a given date:

options: {
              tooltips: {
                  mode: 'index',
                  intersect: false,
                  callbacks: {
                      label: function(tooltipItem, data) {
                          var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
                          var label = data.datasets[tooltipItem.datasetIndex].label;

                          return label + ': ' + value;
                      }
                  }
              },
          }
             

Leave a comment